Databases Reference
In-Depth Information
d
r (equivalently, d - r = Ø), because deleting a tuple that wasn't there in the first place
has no logical effect. In other words, there's no point in making d any bigger than it need
be.
r and i are disjoint (i.e., r
i = Ø), because inserting a tuple that was already there has no
logical effect. In other words, there's no point in making i any bigger than it need be.
d and i are disjoint (i.e., d
i = Ø), because there's no point in deleting a tuple and then
inserting it again (or the other way around), all as part of the same assignment. Of course,
this fact ( i.e., the fact that d
i = Ø) is a logical consequence of the two previous points,
viz., that d
r and r
i = Ø.
These points can be illustrated by means of a Venn diagram (see Fig. A.1, a repeat of Fig.
2.2 from Chapter 2). Explanation: In that diagram, r , d , and i are as above, and u is the
universal relation of the pertinent type (i.e., the relation whose body consists of all tuples with
the same heading as R— including, of course, those tuples that currently appear in R ). Note that
the difference u - r is the (absolute) complement of r , i.e., the relation whose body consists of all
tuples with the same heading as R that don't currently appear in R .
u
i
i
r
r
d
d
Fig. A.1: The delete set d and the insert set i
Note: Of course, the delete set d might be empty, in which case the original assignment is
effectively an INSERT operation. Or the insert set i might be empty, in which case it's
effectively a DELETE operation. Or they might both be empty, in which case the assignment
overall degenerates to a “no op.”
I now show that, given the assignment R := r - d
i (where r , d , and i are as defined
above), the delete set d and the insert set i are unique. Suppose, contrariwise, that
∪ᅠ
r - d1
i1 = r - d2
i2
 
Search WWH ::




Custom Search