Chapter Seven-SQL Views
Chapter Seven-SQL Views
- A view does not necessarily exist in physical form, which limits the
possible update operations that can be applied to views
- The view attribute names can be inherited from the attribute names
of the tables in the defining query
Examples:
Example: Retrieve the last name and first name of all employees who
work on 'ProjectX'.
- Hence, the view is not realized at the time of view definition, but
rather at the time we specify a query on the view
Example:
UPDATING OF VIEWS:
(1) Change the name of the 'ProductX' tuple in the PROJECT relation to
'ProductY'
- It is quite unlikely that the user who specified the view update UV1
wants the update to be interpreted this way
(2) Relate 'John Smith' to the 'ProductY' PROJECT tuple in place of the
'ProductX' PROJECT tuple
- Some view updates may not make much sense; for example,
modifying the TOTAL_SAL attribute of DEPT_INFO as in UV2
- A base relation can have at most one clustering index, but any
number of non-clustering indexes
Example:
Example:
Joined Relations
- Can specify a "joined relation" in the FROM-clause
Examples: