Re: what are keys and surrogates?

From: JOG <jog_at_cs.nott.ac.uk>
Date: Sat, 16 Feb 2008 05:49:04 -0800 (PST)
Message-ID: <e987d0be-304e-4c7f-8204-54c1b2b851a9_at_e60g2000hsh.googlegroups.com>


On Feb 14, 5:54 pm, rp..._at_pcwin518.campus.tue.nl (rpost) wrote:
> JOG wrote:
> >Ok, so if I read you right, you have been supplied with some facts
> >such as:
>
> >1) A and B begat C
> >2) C and D begat A
> >3) A and E begat F
> >etc.
>
> No, that is not right. The facts (more accurately: updates)
> look like this:
>
> A, the son of B, the son of C, the son of A, the son of A, the son of
> B, and X, the daughter of Q, the son of B, the son of B, ....
> begat Q

Ok, so its even simpler than I suggested.

>
> etc.
>
> >Your argument is that, because A is the name of two people (obviously
> >A and C can't be the parents of each other) we should use OID's to
> >distinguish them. Have I read you correctly there?
>
> I'm afraid not. Did you look at the Jesus example?
>
> >Just imagine the query:
> >User: "Did A beget F?"
> >DB: "I don't know. Its ambiguous. What's the OID of the A you are
> >talking about"
> >User: "You know what, strangely I don't seem to be able to find that
> >in the bible..."
>
> It is exactly the *point* of the example that names alone do *not*
> identify persons, while every person is still fully identifiable
> in the database, owing to the oids. (And constraints such as the
> ones I mentioned.)

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)

Above you'd have PK(name, parent). 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.

>
> --
> Reinier
Received on Sat Feb 16 2008 - 14:49:04 CET

Original text of this message