Databases Reference
In-Depth Information
is_entity ( SNO ) AND
has_SNAME ( SNO , SNAME ) AND
has_STATUS ( SNO , STATUS ) AND
has_CITY ( SNO , CITY )
Suppose tuple t currently appears in relvar S. Then the foregoing predicate asserts that:
The SNO value in t identifies a certain entity.
That entity has an SNAME property, the value of which is given by the SNAME value in t .
That entity also has a STATUS property, the value of which is given by the STATUS value
in t .
That entity also has a CITY property, the value of which is given by the CITY value in t .
Of course, the system still doesn't know the entity in question (the entity identified by SNO) is in
fact a supplier in the real world—a supplier “under contract,” in fact—nor does it know what it
means for something to have an SNAME property or a STATUS property or a CITY property.
In a similar manner, we might say the predicate for the projection of suppliers on all
attributes but CITY is:
is_entity ( SNO ) AND
has_SNAME ( SNO , SNAME ) AND
has_STATUS ( SNO , STATUS ) AND
EXISTS CITY ( has_CITY ( SNO , CITY ) )
Finally, I'd like to close this section by confessing that everything I've said so far regarding
relvar predicates in general has deliberately been slightly simplified. Of course, I believe the
treatment is adequate for present purposes; for further specifics, however—“the true story,” as it
were, or at least a slightly truer one—I refer you to Chapter 4 (“The Closed World Assumption”)
of my topic Logic and Databases: The Roots of Relational Theory (Trafford, 2007).
MATCHING, NOT MATCHING, AND EXTEND
Throughout the bulk of this topic, I will of course be discussing the operators of the relational
algebra in some detail, and for the most part I'll take it you're reasonably familiar already with
the operators in question (though definitions can be found if you need them in Appendix B). But
there are certain useful operators, supported by Tutorial D in particular, that I do need to appeal
to fairly frequently but you might not be familiar with, since they're not discussed in most of the
usual textbooks (probably because they're not supported by SQL—at least, not directly). The
first is MATCHING. Here's a definition:
 
Search WWH ::




Custom Search