Views
In the three-level ANSI-SPARC architecture presented in Chapter 2, we described an
external view as the structure of the database as it appears to a particular user. In the relational
model, the word ‘view’ has a slightly different meaning. Rather than being the entire
external model of a user’s view, a view is a virtual or derived relation: a relation that
does not necessarily exist in its own right, but may be dynamically derived from one or
more base relations. Thus, an external model can consist of both base (conceptual-level)
relations and views derived from the base relations. In this section, we briefly discuss
views in relational systems. In Section 6.4 we examine views in more detail and show how
they can be created and used within SQL.
Terminology
The relations we have been dealing with so far in this chapter are known as base relations.
Base A named relation corresponding to an entity in the conceptual schema,
relation whose tuples are physically stored in the database.
We can define views in terms of base relations:
View The dynamic result of one or more relational operations operating on the base
relations to produce another relation. A view is a virtual relation that does not
necessarily exist in the database but can be produced upon request by a
particular user, at the time of request.
A view is a relation that appears to the user to exist, can be manipulated as if it were
a base relation, but does not necessarily exist in storage in the sense that the base
relations do (although its definition is stored in the system catalog). The contents of a
view are defined as a query on one or more base relations. Any operations on the view are
automatically translated into operations on the relations from which it is derived. Views
are dynamic, meaning that changes made to the base relations that affect the view are
immediately reflected in the view. When users make permitted changes to the view, these
changes are made to the underlying relations. In this section, we describe the purpose
of views and briefly examine restrictions that apply to updates made through views.
However, we defer treatment of how views are defined and processed until Section 6.4.
Reviewed by Shopping Sale on 22:57 Rating: 5

No comments:

Powered by Blogger.