Databases Reference
In-Depth Information
GrandMother(x,y) in Example 4.1 provides only information about
the grandmother x and the grandson or granddaughter y. However,
the information about the parent of y is hidden by the view
definition.
Views favor logical data independence, because they allow changing
the logical data structure of the DB without having to perform cor-
responding changes to other rules. For instance, assume that the
base predicate Father(x,y) must be replaced by two different predi-
cates Father1(x,y) and Father2(x,y), each of which contains a subset
of the occurrences of Father(x,y). In this case, if we consider
Father(x,y) as a view predicate and define it as
·
Father(x,y)
Father1(x,y)
¬
Father(x,y)
¬
Father2(x,y)
we do not need to change the rules that refer to the original base
predicate Father.
Views make certain queries easier or more natural to define, since by
means of them we can refer directly to the concepts instead of hav-
ing to provide their definition. For instance, if we want to ask about
the ancestors of Bob, we do not need to define what we mean by
ancestor since we can use the view Ancestor to obtain the answers.
·
Views provide a protection measure, because they prevent users
from accessing data external to their view. Users authorized to access
only GrandMother do not know the information about parents.
·
Real DB applications use many views. However, the power of views can be
exploited only if a user does not distinguish a view from a base fact. That
implies the need to perform query and update operations on the views, in
addition to the same operations on the base facts.
Integrity constraints correspond to requirements to be satisfied by the
DB. In that sense, they impose conditions on the allowable data in addition
to the simple structure and type restrictions imposed by the basic schema
definitions. Integrity constraints are useful, for instance, for caching data-
entry errors, as a correctness criterion when writing DB updates, or to
enforce consistency across data in the DB.
When an update is performed, some integrity constraint may be vio-
lated. That is, if applied, the update, together with the current content of the
Search WWH ::




Custom Search