Database Reference
In-Depth Information
Note:
1.
Any derivable table (which can be obtained via Select
statement) can be defined as a view. The sub-query is not
allowed to include an Order-By-Clause , but this is not
a serious omission, as there are alternatives around this
constraint.
2.
The view is in a way, similar to an insertion with a Select-
Clause . The difference is that the insertion inserts actual data
into a base relation; the view on the other hand, stores virtual
data, i.e. it stores the access path to actual data that resides in
the underlying base relation(s).
3.
The OR REPLACE option replaces an existing view with the
same name.
4.
The FORCE option creates the view even if the underlying
relation does not exist; the default is NOFORCE.
5.
The WITH CHECK OPTION applies to the condition specified
in the sub-query (in the Where-Clause ): It allows insertion
and update of rows based on the condition. This CHECK
OPTION may be given an optional constraint name.
6.
The READ ONLY option ensures that the view cannot be used
for update of the underlying base relation.
Example 1: Create a logical view CSCourses that stores Computer Science
Courses only (assume that the first two characters of the Course Code for Computer
Science is “CS”):
Example 2: Create a logical view that stores for each academic program, a full
breakout of all courses included in that program, as they would appear in a college
bulletin:
 
Search WWH ::




Custom Search