Databases Reference
In-Depth Information
These particular rules were explained in Chapter 1 (at least in outline), but there's quite a
lot more to be said about such rules in general; hence the present section. To be specific:
First of all, you might have already noticed that I've been a little sloppy in my use of
terminology. To be specific, I've been using the term “compensatory action” to refer to
both (a) the action, if any, that's performed after some particular update operation has been
done and (b) the formal specification of such an action in concrete syntax (though I've also
used the term “rule” to refer to this latter construct). What's more, I intend to continue this
practice in the chapters ahead, and hope it won't lead to confusion.
The rules in the example are expressed in a hypothetical and deliberately wordy extension
to Tutorial D . Together, they serve to illustrate the kind of syntax I'll be using for
compensatory actions in the pages to come. 4 Note that d and i are effectively parameters to
those rules, denoting the pertinent delete set and insert set after the update request for
which the rule is compensating has been mapped to one of the form DELETE d FROM R ,
INSERT i INTO R . Note too, therefore, that d and i are disjoint.
It will often be the case that the compensatory actions can be stated in a variety of
syntactically distinct but semantically equivalent forms. For example, the delete rule from
S to LS and NLS—
ON DELETE d FROM S : DELETE ( d WHERE CITY = 'London' ) FROM LS ,
DELETE ( d WHERE CITY ≠ 'London' ) FROM NLS ;
—could equally well be stated as follows:
ON DELETE d FROM S : DELETE ( LS MATCHING d ) FROM LS ,
DELETE ( NLS MATCHING d ) FROM NLS ;
It could even be stated as follows—
ON DELETE d FROM S : DELETE d FROM LS ,
DELETE d FROM NLS ;
—since an attempt to delete a tuple that doesn't exist isn't an error. As an extreme
illustration of the point, it would always be possible to state the rules in terms of pure
4 It goes without saying—I hope!—that I'm not irrevocably wedded to that syntax. It's sufficient for my purpose in this topic,
that's all.
Search WWH ::




Custom Search