Re: teaching relational basics to people, questions

From: Mr. Scott <do_not_reply_at_noone.com>
Date: Sun, 29 Nov 2009 03:31:25 -0500
Message-ID: <v8udnRsywfTArI_WnZ2dnUVZ_rqdnZ2d_at_giganews.com>


<compdb_at_hotmail.com> wrote in message news:9a0f4cc3-ef8c-47b5-afb1-825651df9980_at_13g2000prl.googlegroups.com...

<snip>

> 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

I am going to revisit the example I posted for paul.

In a typical table,

CTRS {COURSE, TEACHER, ROOM, STUDENT}, each row states that a particular COURSE is taught by a particular TEACHER in a particular ROOM to a particular STUDENT.

Now, while it can be argued that there can't be a course without a teacher, or that there can't be a course without a student, or that there can't be a student without a teacher, the room exists independent of whether there is a course, or a teacher or a student. It therefore follows that locating the fact that 'there is a room <ROOM>' only in table CTRS is a problem because then there could only be a room whenever there is at least one course and at least one teacher and at least one student. When one inserts a row into an empty CTRS, one effectively asserts

    that 'there is a course <COURSE>,'
    that 'there is a teacher <TEACHER>,'
    that 'course <COURSE> is taught by teacher <TEACHER>,'
    that 'there is a room <ROOM>,'
    that 'course <COURSE> is held in room <ROOM>,'
    that 'teacher <TEACHER> teaches in room <ROOM>,'
    that 'course <COURSE> is taught by teacher <TEACHER> in room <ROOM>,'
    that 'there is a student <STUDENT>,'
    that 'course <COURSE> is taken by student <STUDENT>,'
    that 'teacher <TEACHER> teaches student <STUDENT>,'
    that 'course <COURSE> is taught by teacher <TEACHER> to student
<STUDENT>,'
    that 'student <STUDENT> studies in room <ROOM>,'
    that 'teacher <TEACHER> teaches student <STUDENT> in room <ROOM>,'
    that 'student <STUDENT> takes course <COURSE> in room <ROOM>,' and
    that 'course <COURSE> is taught by teacher <TEACHER> in room <ROOM> to
student <STUDENT>.'

If you disagree that all of these assertions are a consequence of inserting a single row, then how is it that there can be an answer to the query, "is course <COURSE> held in room <ROOM>?" Unless there is the possibility that 'course <COURSE> is held in room <ROOM>,' there can be no answer (at least not a yes or a no) to the query.

When one deletes that only row, one effectively denies all of those assertions, every one.
It's an all or nothing proposition. Either all of the atomic formulas represented by the row are true, or none of them are. That is consistent with the logical connective between those formulas being IFF rather than AND. If the logical connective were AND, then denying just some of the above assertions should be allowable, but since it is the last row being deleted, there would no longer be anywhere for the positive assertions that remain, leaving the database inconsistent.

That should explain how things work when the first row is being inserted or when the last row is being deleted, but what if there is more than one row? The information content of a table
is the logical sum (disjunction) of the information represented by each row. Isn't it true that

(P IFF Q) OR (P IFF R) = P IFF (Q OR R)? As a result, denying (P IFF R) in this context doesn't deny P. It follows that if there were more than one course taught in room <ROOM>, deleting only one row wouldn't deny that 'there is a room <ROOM>.' Received on Sun Nov 29 2009 - 09:31:25 CET

Original text of this message