Databases Reference
In-Depth Information
conversely, (b) if tuple t plausibly could appear in R at time T but doesn't, then the instantiation p of P
corresponding to t is assumed to be false at time T . In other words (albeit a trifle loosely): Tuple t appears in
relvar R at a given time if and only if it satisfies the predicate for R at that time.
MORE ON SUPPLIERS AND PARTS
Now let's get back to the suppliers-and-parts database as such, with sample values as shown in Fig. 1.1 in the
previous chapter. Here now are definitions of the three relvars in that database, expressed in a language called
Tutorial D (see further explanation following the definitions):
VAR S BASE RELATION
{ SNO CHAR , SNAME CHAR , STATUS INTEGER , CITY CHAR }
KEY { SNO } ;
VAR P BASE RELATION
{ PNO CHAR , PNAME CHAR , COLOR CHAR , WEIGHT RATIONAL , CITY CHAR }
KEY { PNO } ;
VAR SP BASE RELATION
{ SNO CHAR , PNO CHAR , QTY INTEGER }
KEY { SNO , PNO }
FOREIGN KEY { SNO } REFERENCES S
FOREIGN KEY { PNO } REFERENCES P ;
As I said, these definitions are expressed in a language called Tutorial D . Now, I believe that language is
pretty much self-explanatory; however, a comprehensive description can be found if needed in the topic Databases,
Types, and the Relational Model: The Third Manifesto (3rd edition), by C. J. Date and Hugh Darwen (Addison-
Wesley, 2006). 3 Note: As its title suggests, that topic also introduces and explains The Third Manifesto , a precise
though somewhat formal definition of the relational model and a supporting type theory (including, incidentally, a
comprehensive model of type inheritance). In particular, it uses the name D as a generic name for any language that
conforms to the principles laid down by The Third Manifesto . Any number of distinct languages could qualify as a
valid D ; sadly, however, SQL isn't one of them, which is why examples in this topic are expressed (where it makes
any difference) in Tutorial D and not SQL. (Of course, Tutorial D is a valid D ; in fact, it was explicitly designed
to be suitable as a vehicle for illustrating and teaching the ideas of The Third Manifesto .)
Aside: This is as good a point as any to mention that the terminology used in the present topic is based on
that of the Manifesto . As a consequence, it does differ on occasion from that found in some of the design
theory literature. For example, that literature typically doesn't talk about relational headings; instead, it uses
the term relation schema . 4 Nor does it talk about relation variables (relvars); instead, what this topic refers to
as a (relation) value that's assigned to some relation variable it calls an instance of the corresponding
schema . End of aside.
3 Actually Tutorial D has been revised and extended somewhat since that topic was first published. A description of the revised version (which
is the version I'll be using throughout the present topic) can be found both in Database Explorations: Essays on The Third Manifesto and Related
Topics, by C. J. Date and Hugh Darwen (Trafford, 2010) and on the website www.thethirdmanifesto.com (which, as its name suggests, also
contains much current information regarding The Third Manifesto as such).
4 I mustn't give the impression that headings and (relational) schemas are exactly the same thing. Rather, a schema is the combination of a
heading and certain dependencies (including but not necessarily limited to functional and join dependencies in particular, which are discussed in
detail later in this topic).
Search WWH ::




Custom Search