Database Reference
In-Depth Information
12. Views
There is no object on earth which cannot be looked at from a cosmic point of
view.
—F YODOR M IKHAYLOVICH D OSTOYEVSKY
Topics Covered in This Chapter
What Are Views?
Anatomy of a View
Determining and Defining Views
Case Study
Summary
Review Questions
What Are Views?
As you learned in Chapter 3 , Terminology ,” a view is a virtual table composed of fields
from one or more tables in the database; it can also include fields from other views. The
tables and views that comprise a given view are known as the view's base tables . A view is
“virtual” because it draws data from base tables rather than storing data on its own. In fact,
the only information about a view that is stored in the database is its structure; the RDBMS
rebuilds and “repopulates” the view every time you access the view in some manner. Many
major RDBMS programs support views, but some refer to them as saved queries. Your spe-
cific RDBMS program will determine whether you refer to this object as a query or a view.
Note
AlthougheverymajordatabasevendorsupportstheviewI'vejustdescribed,several
vendors support what is known as an indexed (or materialized ) view. An indexed
view is different from a regular view in that it does store data, and its fields can
be indexed to improve the speed at which the RDBMS processes the view's data.
A full discussion of indexed views is beyond the scope of this topic because it is a
vendor-specific implementation issue. However, you should research this topic fur-
ther if you are working with a client/server or mainframe RDBMS program.
Search WWH ::




Custom Search