Re: Nearest Common Ancestor Report (XDb1's $1000 Challenge)

From: thirdrock <iktaccounts>
Date: Fri, 21 May 2004 17:32:02 +1000
Message-ID: <opr8b9vou4h454zx_at_news.optusnet.com.au>


I was cheering you on until you said this ...

>
> You might be surprised to hear this, but there's a reason that the
> relational model is called "relational". It's about storing relations.

No, unless I miss-understood what you meant by that. A relation refers to the relationship between data members of the same 'table'. A 'table' was originally called a relation. Joins between relations in not the reason why the relational model is called relational.

Or is that what you said??

> There would have been redundancy if each object's class was stored along
> with it's reference, like this:
>
> thing class otherThing otherClass hierarchy
> --------- --------- ---------- ---------- ---------
> (snip some rows)
> 'fido' 'dog' 'john' 'person' 'leader'
> 'fido' 'dog' 'mary' 'person' 'leader'
> 'fido' 'dog' 'luke' 'person' 'leader'

The above table does not meet the 1N rule, correct?

>
> This example of a bad design has redundant storage of the same relation.

Er.. actually it's an example of non-normalised data. I don't think design has anything to do with it.

>
> You seem to be thinking that storing the character strings 'fido' and
> 'leader' several times is bad.

Bad, or just not normalised?

>
> This does indeed reduce the number of times you'll see the string 'fido'
> in the database to 1. But we still have multiple references to fido (note
> the important distinction between fido (no quotes - a dog) and 'fido'
> (quotes - a name). We didn't remove anything from the database, we only
> changed the way things are references and added an extra relation.

True, but if fido goes down to the Names Registry and changes his name to 'FiFi' in preparation for a sex change operation, then that change is not cascaded out to all the records of things. Whereas in your second table, it does. So what exactly is your point? Did you say that your first table is normalised?

>
> You claim that my model has redundancy. But if I follow your suggestion
> of
> "improving", I end up with the same data in the existing tables and some
> extra relations that I could do without.

No, you end up with normalised data, which I think is Neo's point (is it Neo?)

>
> I don't know what definition of "redundant" you've been taught. I think
> that "Exceeding what is necessary or natural; superfluous." (*) does
> quite
> accurately describe the schema with both thingID and thingName, not my
> original schema!

Well, writing a trigger to cascade out fido's name change to 'fifi' is redundant if your model was such that it was un-neccessary.

>
> XDb1 fails in a much more spectacular way, as I'll explain in another
> message.
>
I'll look for that message too.

Have fun.

Ian

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Received on Fri May 21 2004 - 09:32:02 CEST

Original text of this message