Re: The MySQL/PHP pair

From: Paul <paul_at_test.com>
Date: Thu, 04 Nov 2004 21:25:53 +0000
Message-ID: <418a9e61$0$43602$ed2e19e4_at_ptn-nntp-reader04.plus.net>


Laconic2 wrote:
>> I think 1NF has a very mathematical basis. Everything stems from
>> the fact that you're representing logical propositions. When
>> thinking about relational theory, I always find it helpful to
>> sometimes forget about relations themselves and go back to first
>> principles: predicates and propositions.
>
> But 1NF is defined for relations, isn't it?

Yes, but the underlying reason for 1NF comes from the fact that the relations are specifically representing first order logical predicates.

>> So a 1NF one is "John's car is blue"
>>
>> A non-1NF one is "Bill said on Monday 'John's car is blue'"

> 
> The above distinction is a useful one to make,  but it has nothing to
> do with 1NF, does it?

I think it does. If you see the string "John's car is blue" in the second sentence just as a string, then it is in 1NF. If you see it as a proposition, it isn't in 1NF. (By "you" here I mean the relational system).

Check out this page on Quine's Paradox:
http://en.wikipedia.org/wiki/Quine%27s_paradox

The basic idea is to consider this paradoxical sentence:

  "Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.

Can we couch this in terms of relational database theory?

Suppose I have a relation that had one column of type 'tuple' (or of type 'relation' maybe). The meaning of the relation is that it stores predicates P, where "P yields falsehood when preceded by its quotation".

Now suppose we are in a non-1NF DBMS, and the tuple-valued (or relation-valued) column is regarded as a nested relation. What if we insert the predicate "Yields falsehood when preceded by its quotation" into the inner tuple (or relation)?

Maybe you'd say you can't insert it. But suppose we add a second column that can take the values true or false, and asserts the truth or falsity of the predicates in the first column? If we say the predicate is true, it's false. If we say it's false, it's true.

If instead of considering "Yields falsehood when preceded by its quotation" as a predicate (non-1NF), we consider it as a plain string (1NF), there's no problem, because the DBMS doesn't understand what it means.

The conclusion I would draw is that it's dangerous to allow nested relations i.e. to allow DBMSs to break 1NF.

The "no nested relations" part of 1NF is exactly parallel to the "first order logic only" part of the foundations of relational databaes theory.

Paul. Received on Thu Nov 04 2004 - 22:25:53 CET

Original text of this message