Databases Reference
In-Depth Information
Query 1.2: Get supplier numbers of suppliers who are currently
unable to supply any part at all.
·
S { S# } MINUS SP { S# }
Observe that Query 1.1 involves a simple projection and Query 1.2 involves
the difference between two such projections. Later, when we consider tem-
poral analogs of these two queries, we will find that they involve temporal
analogs of these two operators (see Section 5.8). Temporal analogs of other
relational operators can be defined as well.
5.3.1
Semitemporalizing Suppliers and Parts
In order to proceed gently, our next step is to semitemporalize (so to speak)
relvars S and SP by adding a timestamp attribute, SINCE, to each and
renaming them accordingly. See Table 5.2.
For simplicity, we do not show real timestamps in Table 5.2; instead,
we use symbols of the form d01, d02, and so on, where the d can conven-
iently be pronounced day, a convention to which we adhere throughout
this chapter. (Our examples thus all make use of timepoints that are,
specifically, days.) We assume that day 1 immediately precedes day 2,
day 2 immediately precedes day 3, and so on; also, we do not propagate the
insignificant leading zeros when we write expressions such as day 1 (as
you can see).
The predicate for S_SINCE is Since day SINCE it has been the case
that supplier S# has been named SNAME, has had status STATUS, has been
located in city CITY, and has been under contract. The predicate for
SP_SINCE is Since day SINCE it has been the case that supplier S# has
been able to supply part P#.
5.3.1.1 Constraints (Semitemporal Database)
The primary and foreign keys for this semitemporalized database are the
same as before. However, we need an additional constraint—one that might
be thought of as augmenting the foreign key constraint from SP_SINCE to
S_SINCE—to express the fact that no supplier can supply any part before
that supplier is placed under contract. In other words, if tuple sp in
SP_SINCE references tuple s in S_SINCE, the SINCE value in sp must not
be less than that in s :
Search WWH ::




Custom Search