Databases Reference
In-Depth Information
Chapter 14
U p d a t i n g t h r o u g h E x p r e s s i o n s
When expressions conflict
And views contradict
The results that emerge
These rules will predict
—Anon.: Where Bugs Go
Throughout the topic prior to this point, I've been concerned primarily with the question of
updating through some individual relational operation (updating a restriction, updating a
projection, and so on). What's more, I've been assuming, more or less tacitly, that the rules for
updating a relvar defined by means of some more complicated expression can be determined by
combining the rules for the operations involved in that expression—for example, updating a
union of two joins can be done by first applying the rules for updating a union and then applying
the rules for updating joins. Now it's time to take a closer look at that assumption.
I observe first of all that the assumption is surely correct in principle. The reason is that the
alternative is just too horrible to contemplate! To spell it out, the alternative in question would
mean treating every expression as a special case—i.e., defining one set of rules for updating the
union of two joins, and another for updating the difference of two joins, and another for updating
the join of a union and a difference, and so on and so forth ad infinitum.
To say it again, the assumption is surely correct. However, it does raise certain questions,
questions to which the answers don't always seem entirely clear (at least, not to me, and not at
this time). Thus, I have two aims in this chapter: First, I want to explain and discuss some of
those questions; second, I want to draw, or attempt to draw, certain conclusions from those
discussions. Do please note, however, that the chapter is unavoidably somewhat speculative in
nature. I freely admit I don't have all the answers at this time.
SEMANTICS NOT SYNTAX (?)
Consider the following example (“Example 1”). Starting with our usual suppliers relvar S,
suppose we define views V1 and V2 as follows:
 
Search WWH ::




Custom Search