Re: teaching relational basics to people, questions

From: <compdb_at_hotmail.com>
Date: Fri, 27 Nov 2009 19:32:35 -0800 (PST)
Message-ID: <9a0f4cc3-ef8c-47b5-afb1-825651df9980_at_13g2000prl.googlegroups.com>


On Nov 26, 2:19 am, "Mr. Scott" <do_not_re..._at_noone.com> wrote:

You really don't understand the relational model.

> That sentence applies not only to SQL tables but also to Codd's time-varying
> relations and Date and Darwen's relvars. Date defines a relvar's predicate
> as the conjunction of all of the constraints that apply to it, but I think
> he's wrong.

The "relvar predicate" that is the conjunction of all its constraints is the characteristic predicate of the set of tuples that can ever be in the relation. Date now calls this the "total relvar constraint" but it used to be called the "internal predicate" (which term is now deprecated by Date). But there is a different "relvar predicate", which the designer specifies to tell the user what the relvar is saying about the world. Date now calls this the "relvar predicate"; it used to be called the "external predicate" (which term is now deprecated by Date).

The relationship between the two "predicates" is as follows. The designer specifies the relvar predicate so that a user updating the database can observe the world and figure out whether a given tuple makes it true and so that a user looking at the database can find out what is true of the world. Next the designer figures out all the possible tuples that could ever turn up in a relation because of the way the world can be and then writes the total relvar constraint so the dbms can tell the user they made an error if they ever try to put some other tuple into the relation.

> The logical connective should be IFF rather than AND. The
> difference is subtle, and may at first glance appear problematic since IFF
> is true whenever none of its operands are true, but under the closed world
> assumption, the only atomic formulas that are ever represented in the
> database are those that are supposed to be true, so there is no harm in
> choosing IFF over AND. The main reason I think the connective should be IFF
> rather than AND involves deletes. While inserting a row effectively asserts
> that all of the atomic formulas represented by the row are true

A row in a relation asserts one proposition for each syntactically valid row. If a such a row is in the relation then the proposition is its relvar predicate with free variables replaced by attribute values. If such a row is not in the relation then the proposition is its relvar predicate with free variables replaced by attribute values, negated. Since these are all asserted, that's the same as asserting their conjunction.

If one were to use the "open world assumption" then the latter propositions are not asserted. But then a dbms cannot calculate the answer for a query that can only be written using a "NOT" (or in relational algebra, MINUS, assuming the other primitives are JOIN, UNION, PROJECT, EQUALS-RESTRICT and RENAME).

, regardless
> of the whether the logical connective is IFF or AND,

I don't know what "atomic formulas" you think are being ANDed/IFFed. But if the database were asserting the IFF of some propositions then it would be saying they are either all true or all false. So a user would know that either they are all true or all false, but not which. (That's a rather moot hypothetical since it *isn't* what a database asserts.) Whereas in the relational model the user knows they are all true. (That is, all the propositions above, some of which are ground terms and some of which are negated ground terms, are all true.)

> the same can't be said
> for deletes. When the logical connective is IFF, deleting a row effectively
> denies that any (not all) of the atomic formulas represented by the row are
> true, but when the logical connective is AND, deleting a row effectively
> denies that all (not any) of the atomic formulas represented by the row are
> true, which can be even if only one isn't.

I don't know what you mean by "the atomic formulas represented by a row". If one thinks of a relation's predicate as being an arbitrary wff (it's usually thought of as being in natural language, or as being wffs with natural language for ground terms) then the truth value of a particular constituent atomic formula when the overall predicate is true depends (like usual in predicate logic) on the connectives/ quantifiers. A row does not have a bunch of things ANDed together; the propositions above are ANDed together (or more simply, just asserted).

After a delete a row it is no longer in the relation. So the database is asserting the negation of the proposition that you get by substituting its attribute values for attribute names in the proposition.

> If some but not all of the
> atomic formulas represented by a row were true, but a row can't be in the
> table unless they're all true, then where is that positive information to be
> stored? Without anywhere to store it, the database is inconsistent.

Once again, a row does not in general assert the conjunction of wffs.

If you think otherwise please explain very clearly, hopefully with a fully worked out simple example, because you won't be able to assume I know what you are talking about, because what you have written is not how the relational model works. From this message you should also be able to work that example out "correctly".

philip Received on Sat Nov 28 2009 - 04:32:35 CET

Original text of this message