Databases Reference
In-Depth Information
By the way, don't confuse domains as understood in the relational world with the construct of the same name in
SQL, which (as explained in SQL and Relational Theory ) can be regarded at best as a very weak kind of type.
2.5
See the body of the chapter.
2.6 Relvar S: Supplier SNO is named SNAME and is located in city CITY, which has status STATUS. Relvar P:
Part PNO is named PNAME, has color COLOR and weight WEIGHT, and is stored in city CITY. Relvar SP:
Supplier SNO supplies part PNO in quantity QTY.
2.7
No answer provided.
2.8 The Closed World Assumption says, loosely, that everything stated or implied by the database is true and
everything else is false. 1 And The Open World Assumption ─yes, there is such a thing─says that everything stated or
implied by the database is true and everything else is unknown. What are the implications? Well, first let's agree to
abbreviate Closed World Assumption and Open World Assumption to CWA and OWA, respectively. Now consider
the query “Is supplier S6 in Rome?” (meaning, more precisely, “Is there a tuple for supplier S6 in relvar S with
CITY value equal to Rome?”). Tutorial D formulation:
( S WHERE SNO = 'S6' AND CITY = 'Rome' ) { }
As explained in SQL and Relational Theory , this expression evaluates to either TABLE_DEE or TABLE_DUM
(where TABLE_DEE and TABLE_DUM are the only relations of degree zero; TABLE_DEE contains just one
tuple, and TABLE_DUM contains no tuples at all). Under the CWA, moreover, if the result is TABLE_DEE, it
means the answer is yes , supplier S6 does exist and is in Rome; if the result is TABLE_DUM, it means the answer is
no , it's not the case that supplier S6 exists and is in Rome. Under the OWA, by contrast, TABLE_DEE still means
yes , but TABLE_DUM means it's unknown whether supplier S6 exists and is in Rome.
Now consider the query “If supplier S6 exists, is that supplier in Rome?” (note the logical difference between
this query and the one discussed above). Observe that the answer to this query has to be no if relvar S shows
supplier S6 as existing but in some city other than Rome, regardless of whether we're talking about the CWA or the
OWA. 2 So here's the Tutorial D formulation:
TABLE_DEE MINUS ( ( S WHERE SNO = 'S6' AND CITY ≠ 'Rome' ) { } )
Note carefully, therefore, that if this expression evaluates to TABLE_DUM, that TABLE_DUM has to mean no ,
even under the OWA . Thus, the OWA suffers from an inherent ambiguity: Sometimes TABLE_DUM has to mean
unknown and sometimes it has to mean no ─and of course we can't say (in general) which interpretation applies
when.
Just to beat the point to death: TABLE_DEE and TABLE_DUM simply do mean yes and no , respectively, in
the relational world, and there's no “third relation” of degree zero available to represent the “third truth value” that
the OWA fundamentally requires. Thus, the OWA and the relational model are fundamentally incompatible with
each other.
1 To illustrate what I mean by “stated or implied” here, consider the shipment tuple (S1,P1,300) shown in Fig. 1.1. That tuple states the
proposition “Supplier S1 supplies part P1 in quantity 300.” However, it also implies several other propositions─for example, the proposition
“Supplier S1 supplies at least one part in quantity 300.”
2 By contrast, the answer has to be yes if relvar S has no tuple for supplier S6 (in logic, “if p then q ” is true if p is false—again, regardless of
whether we're talking about the CWA or the OWA).
Search WWH ::




Custom Search