Databases Reference
In-Depth Information
cascading to either will cause an additional cascade to the other one anyway, if logically
necessary).
In the case of the delete rule, the restriction conditions could be dropped without significant
loss.
As for a user who sees just relvar ULP, I hope it's obvious without going into detail that
such a user can behave in all respects exactly as if that relvar is a base relvar.
Let me now point out that if NLS and NPS are indeed views of relvar S, then ULP could
alternatively have been defined directly as a restriction of S, thus:
S WHERE CITY 'London' OR CITY 'Paris'
Let's call this restriction ULP′. Clearly, then, updates on ULP′ should have the same effect as
updates on ULP—and so they do. To be specific:
INSERT: Tuples to be inserted into either ULP or ULP′ must have CITY value either not
London or not Paris and so must be inserted into the other as well.
DELETE: Tuples to be deleted from either ULP or ULP′ certainly do have CITY value
either not London or not Paris and so must be deleted from the other as well.
(Once again, I'll have more to say about the general question of updates on relvars with different
but equivalent definitions in Chapter 14.)
As you can see, then, this second example isn't seriously different in kind from the one
discussed in the previous section (essentially because both preserve information equivalence).
So let's move on to look at an example where information equivalence is lost.
EXAMPLE 3: IMPLICIT OVERLAP
This example is an edited version of Example 2 from the previous chapter. Just to remind you,
the basic situation is as follows: At any given time, some parts are on sale, some parts are in
stock, and some are both. Furthermore, this state of affairs is represented by means of two
relvars, each with just a single attribute PNO—one relvar (PL) giving part numbers for parts on
sale, the other (PK) giving part numbers for parts in stock. Of course, the union of these two
relvars—call it ULK—gives part numbers for parts that are either on sale or in stock or both.
The point is, however, we can't tell just by looking at a given tuple in the original parts relvar P
whether that part ought to be represented in PL or PK or both or neither. So the predicates are as
follows:
PL: Part PNO is on sale.
 
Search WWH ::




Custom Search