Re: what are keys and surrogates?

From: rpost <rpost_at_pcwin518.campus.tue.nl>
Date: Sat, 16 Feb 2008 23:44:27 +0100
Message-ID: <34e9c$47b7674b$839b4533$9257_at_news1.tudelft.nl>


JOG wrote:

>I totally agree - in the example a name alone does not identify a
>person. What is illogical is to then jump to saying "hence we need an
>OID". It's bizarre.
>
>If there are two Jesus's and to distinguish them in real life you need
>to specify their parent, as in "Jesus, son of Joseph, currently lives
>in Nazareth", then that's what you use in the database:
>
>(Name: Jesus, Parent:Joseph, Lives:Nazareth)
>(Name: Jesus, Parent:Frank, Lives:Eindhoven)

Wait, in my example we didn't specify "Lives", we only had "Name" and "Parent" (actually, "Father" and "Mother" but the Bible only uses "Father".

>Above you'd have PK(name, parent).

Yes, thus far we agree. Now the point of the example is that Parent cannot be the *name* of a parent, but must be a reference to a person (i.e. to a tuple in the relation). This is because many persons have the same names. And that's what the oids are for.

>If that's not enough and you need
>grandparents to distinguish them, then use that too, and so on. Just
>work out how you identify something in real life and then use that in
>the database.

Yes, that's exactly what I've been doing here.

-- 
Reinier
Received on Sat Feb 16 2008 - 23:44:27 CET

Original text of this message