Databases Reference
In-Depth Information
information equivalence—the design consisting of ULP by itself is information equivalent to the
design consisting of NLS and NPS in combination. Note: The fact that {SNO} is a key for ULP
in particular guarantees that if some supplier is represented in both NLS and NPS, then the two
tuples representing that supplier are in fact one and the same. Of course, this constraint will be
enforced automatically if NLS and NPS are in fact views of the suppliers relvar S.
Here now are the compensatory actions—first, the rules for cascading updates on NLS to
NPS and vice versa (which are the same as their counterparts in Chapter 9, of course):
ON INSERT i INTO NLS : INSERT ( i WHERE CITY 'Paris' ) INTO NPS ;
ON INSERT i INTO NPS : INSERT ( i WHERE CITY 'London' ) INTO NLS ;
ON DELETE d FROM NLS : DELETE ( d WHERE CITY 'Paris' ) FROM NPS ;
ON DELETE d FROM NPS : DELETE ( d WHERE CITY 'London' ) FROM NLS ;
And here are the rules for cascading updates on NLS and NPS to the union view ULP:
ON INSERT i INTO NLS : INSERT i INTO ULP ;
ON INSERT i INTO NPS : INSERT i INTO ULP ;
ON DELETE d FROM NLS : DELETE ( d WHERE CITY 'Paris' ) FROM ULP ;
ON DELETE d FROM NPS : DELETE ( d WHERE CITY 'London' ) FROM ULP ;
Finally, here are the rules for updates on the union relvar as such:
ON DELETE d FROM ULP :
DELETE ( d WHERE CITY 'London' ) FROM NLS ,
DELETE ( d WHERE CITY 'Paris' ) FROM NPS ;
ON INSERT i INTO ULP :
INSERT ( i WHERE CITY 'London' ) INTO NLS ,
INSERT ( i WHERE CITY 'Paris' ) INTO NPS ;
Points arising:
Let's focus on the insert rule for a moment. As far as relvar ULP is concerned, it would of
course be sufficient to cascade to just one of the relvars NLS and NPS. But cascading to
either NLS or NPS will (if logically necessary) cause an additional cascade to the other
relvar anyway; and since there's no good reason to favor one over the other, at least in
concrete syntax (assuming, of course, that both relvars are visible)—it's a difference that
makes no difference, so to speak—I've specified cascades to both, for reasons of symmetry
and explicitness.
As a matter of fact, a similar remark applies to the delete rule also (in general, deleting
from a union needs to cascade to both of the relvars involved; in the case at hand, however,
 
Search WWH ::




Custom Search