Databases Reference
In-Depth Information
3.
Is aware of the following compensatory actions:
ON DELETE dt FROM ST , DELETE dc FROM SC ,
INSERT it INTO ST , INSERT ic INTO SC :
WITH ( t1 := it JOIN SC , t2 := ic JOIN ST ,
t3 := SC MATCHING dt , t4 := ST MATCHING dc ) :
INSERT t1 { SNO , STATUS } INTO ST ,
INSERT t2 { SNO , CITY } INTO SC ,
DELETE t3 FROM SC ,
DELETE t4 FROM ST ;
(This rule might look a little complicated, but it's basically just an edited version of the rule
for DELETEs and INSERTs on ST and SC from the previous section, revised primarily to
replace references to S by references to ST and/or SC, as appropriate.)
Given all of the above, I'll leave it as an exercise to show that, from this user's perspective,
all updates on ST and/or SC work exactly as described in the previous section.
Information Hiding
Now what about a user who sees only (say) relvar ST? Well, such a user knows the predicate
(see above) and knows also that {SNO} is a key for that relvar, but of course isn't aware of any
constraints that mention either SC or S. Perhaps more to the point, that user isn't aware of any
compensatory actions, either. Clearly, then, that user can't be allowed to insert tuples into relvar
ST, nor to update supplier numbers within that relvar, because such operations have the potential
to violate constraints of which this user is, and must be, unaware. (Note too that updating ST to
change a supplier's status implicitly requires relvar SC to exist, even if that relvar is hidden from
the user. Thus, if ST is defined and SC is not—in particular, if ST is defined without SC purely
for security reasons—then such updates will have to be prohibited also.)
EXAMPLE 1 CONTINUED: VIEWS
In Chapter 4, I showed it made essentially no difference if some or all of the relvars under
discussion were views instead of base relvars, just so long as information equivalence was
preserved. And as I'm sure you've been expecting, the message here is the same, viz.:
Everything I've said in this chapter so far applies pretty much unchanged if some or all of the
relvars concerned are views . To be specific, suppose now that S is a base relvar and ST and SC
are views. Then:
 
Search WWH ::




Custom Search