Databases Reference
In-Depth Information
Query 2.1: Get supplier numbers of suppliers who are currently able
to supply some part, showing in each case the date since when they
have been able to do so.
If supplier Sx is currently able to supply several parts, then Sx
has been able to supply some part since the earliest SINCE date
shown for Sx in SP_SINCE (for example, if Sx is S1, that earliest
SINCE date is d04 ). Hence:
·
SUMMARIZE SP PER SP {S#} ADD MIN (SINCE) AS SINCE
Result:
S#
SINCE
S1
d04
S2
d08
S3
d08
S4
d04
Query 2.2: Get supplier numbers of suppliers who are currently
unable to supply any part at all, showing in each case the date since
when they have been unable to do so.
In our sample data there is just one supplier who is currently
unable to supply any parts at all, supplier S5. However, we cannot
deduce the date since when S5 has been under contract but unable
to supply any parts, because there is insufficient information in the
database—the database is still only semitemporalized. For exam-
ple, suppose d10 is the current day. Then it might be that S5 was
able to supply at least one part from as early as d02, when S5 was
first appointed, up to as late as d09 ; or, going to the other extreme,
it might be that S5 has never been able to supply anything at all.
To have any hope of answering Query 2.2, we must complete
the temporalizing of our database, or at least the SP portion of it.
To be more precise, we must keep historical records in the database
showing which suppliers were able to supply which parts when, as in
the section immediately following.
·
5.3.2
Fully Temporalizing Suppliers and Parts
Table 5.3 shows a fully temporalized version of our suppliers and parts data-
base. Observe that the SINCE attributes have become FROM attributes, and
 
Search WWH ::




Custom Search