View Sen Zhang. Views are very common in business systems users view of data is simplified a form of security - user sees only the data he/she needs to.

Slides:



Advertisements
Similar presentations
View (virtual table). View A VIEW is a virtual table A view contains rows and columns, just like a real table. The fields in a view are fields from one.
Advertisements

Basic SQL Introduction Presented by: Madhuri Bhogadi.
Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
Introduction To SQL Lynnwood Brown President System Managers LLC Copyright System Managers LLC 2003 all rights reserved.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
A Guide to SQL, Seventh Edition. Objectives Create a new table from an existing table Change data using the UPDATE command Add new data using the INSERT.
Introduction to Structured Query Language (SQL)
A Guide to Oracle9i1 Using SQL Queries to Insert, Update, Delete, and View Data Chapter 3.
1 Table Alteration. 2 Altering Tables Table definition can be altered after its creation Adding columns Changing columns’ definition Dropping columns.
Chapter 3: Using SQL Queries to Insert, Update, Delete, and View Data
Concepts of Database Management Sixth Edition
A Guide to MySQL 7. 2 Objectives Understand, define, and drop views Recognize the benefits of using views Use a view to update data Grant and revoke users’
A Guide to SQL, Seventh Edition. Objectives Understand, create, and drop views Recognize the benefits of using views Grant and revoke user’s database.
CSC 2720 Building Web Applications Database and SQL.
INTEGRITY Enforcing integrity in Oracle. Oracle Tables mrobbert owner granted access.
SQL's Data Definition Language (DDL) – View, Sequence, Index.
Guide to Oracle10G1 Using SQL Queries to Insert, Update, Delete, and View Data Chapter 3.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
ASP.NET Programming with C# and SQL Server First Edition
10/31/2012ISC239 Isabelle Bichindaritz1 SQL Graphical Queries Design Query By Example.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
ITBIS373 Database Development
Other database objects (Sequence). What Is a Sequence? A sequence: Automatically generates sequential numbers Is a sharable object Is typically used to.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
Structure Query Language SQL. Database Terminology Employee ID 3 3 Last name Small First name Tony 5 5 Smith James
Chapter 6 Database Administration
Using Special Operators (LIKE and IN)
DATA MANIPULATION andCONTROL
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
Chapter 9 Query-by-Example Pearson Education © 2009.
Database Programming Sections 11 & 12 – Creating, and Managing Views, Sequences, Indexes, and Synonymns.
CS146 References: ORACLE 9i PROGRAMMING A Primer Rajshekhar Sunderraman
SQL Unit – 2 Base Knowledge Presented By Mr. R.Aravindhan.
1 CSE 2337 Introduction to Data Management Access Book – Ch 1.
SQL Basics. What is SQL? SQL stands for Structured Query Language. SQL lets you access and manipulate databases.
SQL Structured Query Language 1. Data Definition Language (DDL) is used to manage table and define data structure i.e. CREATE, ALTER, DROP Data Control.
Database Management COP4540, SCS, FIU Physical Database Design (2) (ch. 16 & ch. 6)
Views. Objectives Create views Modify/Drop Views Insert/Delete/Update to/from views Retrieve data from views.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
Chapter 13 Views Oracle 10g: SQL. Oracle 10g: SQL2 Objectives Create a view, using CREATE VIEW command or the CREATE OR REPLACE VIEW command Employ the.
Database Management System. DBMS A software package that allows users to create, retrieve and modify databases. A database is a collection of related.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
Manipulating Data Lesson 3. Objectives Queries The SELECT query to retrieve or extract data from one table, how to retrieve or extract data by using.
A Guide to MySQL 6. 2 Objectives Create a new table from an existing table Change data using the UPDATE command Add new data using the INSERT command.
A Guide to SQL, Sixth Edition 1 Chapter 5 Updating Data.
CSCI N311: Oracle Database Programming 5-1 Chapter 15: Changing Data: insert, update, delete Insert Rollback Commit Update Delete Insert Statement –Allows.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Constraints and Views Chap. 3-5 continued (7 th ed. 5-7)
SQL: Structured Query Language It enables to create and operate on relational databases, which are sets of related information stored in tables. It is.
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
Dr. Chen, Oracle Database System (Oracle) 1 Basic Nested Queries and Views Jason C. H. Chen, Ph.D. Professor of MIS School of Business Gonzaga University.
Oracle & SQL Introduction
Prepared by : Moshira M. Ali CS490 Coordinator Arab Open University
CS580 Advanced Database Topics
Basic Nested Queries and Views
Chapter 5 Sequences.
A Guide to SQL, Eighth Edition
This allows me to insert data for specified fields and not for other fields in the structure.
SQL .. An overview lecture3.
Chapter 2 Views.
Structured Query Language – The Fundamentals
Introduction To Structured Query Language (SQL)
Lesson 23 Getting Started with Access Essentials
Chapter 9 Query-by-Example Pearson Education © 2009.
SQL Views Presented by: Dr. Samir Tartir
Query-by-Example Transparencies
Presentation transcript:

View Sen Zhang

Views are very common in business systems users view of data is simplified a form of security - user sees only the data he/she needs to if the primary key is preserved, updates to a base table through a view is possible, but usually not.

Creating and Using Database Views Similar to storing the result of a query in the database Based on a source query that: –can specify a subset of a single table’s fields or records –can join multiple tables Can be used to enforce security (user has access to view but not underlying table)

Views: Use a Create View command essentially a select specifying the data that makes up the view Create View Enames as select lname, fname from employee CREATE VIEWEnames (lname, fname) AS SELECTLNAME, FNAME FROMEMPLOYEE create Create or replace view … as…

Once correctly created, Views are used like tables for selecting, inserting, updating and deleting data (only updatable views can be modified. You won’t be tested for this feature!)

Creating and Using Database Views In Oracle, views can be updateable if: –SELECT clause contains only fieldnames, no functions or calculations –cannot contain the ORDER BY, DISTINCT, or GROUP BY clauses, group functions, or set operators –search condition cannot contain a nested query

Creating and Deleting Views CREATE OR REPLACE VIEW view_name AS source_query; DROP VIEW viewname;

Drop view

Alter view

Summary Queries can be “saved” by creating a view Views can be used like tables to select, insert, update and delete data