Databases Reference
In-Depth Information
The following constraints (actually EQDs) clearly hold: 14
CONSTRAINT ... NLS = ( S WHERE CITY 'London' ) ;
CONSTRAINT ... NPS = ( S WHERE CITY 'Paris' ) ;
So does this one (another EQD):
CONSTRAINT ... ( NLS WHERE CITY 'Paris' ) =
( NPS WHERE CITY 'London' ) ;
As this latter constraint indicates, views NLS and NPS overlap , in the sense that, in
general, certain tuples appear in both; in fact, the tuples in question must appear in both, in order
to guarantee that the constraint is always satisfied. To spell the point out, a given tuple t
appearing in relvar S will and must also appear in both NLS and NPS, if and only if the CITY
value in that tuple t is neither London nor Paris. (I note in passing, therefore, that relvars NLS
and NPS together violate The Principle of Orthogonal Design . See Database Design and
Relational Theory for further explanation of this point.)
It follows that certain updates on either of NLS and NPS will necessarily cascade to the
other one, albeit indirectly. For example, here are the insert rules for S, NLS, and NPS: 15
ON INSERT i INTO S :
INSERT ( i WHERE CITY 'London' ) INTO NLS ,
INSERT ( i WHERE CITY 'Paris' ) INTO NPS ;
ON INSERT i INTO NLS : INSERT i INTO S ;
ON INSERT i INTO NPS : INSERT i INTO S ;
Now observe what happens if we insert, say, the tuple (S6,Lopez,30,Madrid) into NLS.
First of all, the insert cascades from NLS to S and the same tuple is thus inserted into relvar S;
then this latter insert cascades from S to NPS, and the same tuple is inserted into this latter relvar
as well. In effect, therefore, the insert has cascaded from NLS to NPS.
Here now are the delete rules (and observe that here too there's potential for an operation
on one of NLS and NPS to cascade to the other, indirectly):
14 Observe that once again we're dealing with a situation in which information equivalence holds (in particular, relvar S is equal
to the union of relvars NLS and NPS, though this time the union isn't disjoint). Note, incidentally that the predicates for NLS
and NPS violate the discipline suggested in Chapter 2 (in a footnote) to the effect that the predicates for relvars R1 and R2 should
preferably be such as to preclude the possibility that the same tuple might satisfy both.
15 Although I've said that in practice insert and delete rules can be combined, I'll continue to show them separately for reasons of
clarity, most of the time.
Search WWH ::




Custom Search