Professional Documents
Culture Documents
Chapter 9-32
Efficient View Implementation
View materialization: involves physically
creating and keeping a temporary table
assumption: other queries on the view will
follow
concerns: maintaining correspondence
between the base table and the view when
the base table is updated
strategy: incremental update
Chapter 9-33
Incremental Update
In SQL, the clause WITH CHECK
OPTION must be added at the end of
the view definition if a view is to be
updated. This allows the system to
check for view updatability and to plan
an execution strategy for view updates.
Update from Views
Efficient Mapping
Inefficient Mapping
Self Assessment Problem (1/2)
Specify the following views in SQL on
the COMPANY database schema
A view that has the department name,
manager name, and manager salary for
every department.
A view that has the employee name,
supervisor name, and employee salary for
each employee who works in the
‘Research’ department.
Self Assessment Problem (2/2)
A view that has the project name, controlling
department name, number of employees, and
total hours worked per week on the project
for each project.
A view that has the project name, controlling
department name, number of employees, and
total hours worked per week on the project
for each project with more than one
employee working on it.