Re: what are keys and surrogates?

From: JOG <jog_at_cs.nott.ac.uk>
Date: Sat, 16 Feb 2008 19:44:40 -0800 (PST)
Message-ID: <4541af5e-4ebc-4c70-8a23-1c9bfe022462_at_e60g2000hsh.googlegroups.com>


On Feb 16, 10:44 pm, rp..._at_pcwin518.campus.tue.nl (rpost) wrote:
> 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).

Why on earth can't people be identified inside the database by their name, and parent's name, if that works outside? If you are saying that its because two people may have the same name and the same Parent_name, of course yes that would break things, but it would / equally/ stump you in real life too.

So to deal with it in real life you might specify the Grandparent's name too. And if that were the same, then the Great-GrandParent as well. If that gives you the way to identify the person uniquely, excellent - you now know if you ever need to build a database for the info, you can use a table with a PK(Name, P, GP, GPP). If not, just keep on going with those ancestors.

No OID's necessary.

> 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.

No, I meant if you use someone's ancestors to identify them in real life, then that's exactly what you should use to identify them in a tuple.

I'm baffled why you'd think you'd corresponded to real life at all by inventing invisible numbers. There are no OID's in the bible. And your example showed people being successfully referred to by their parent, grandparent, etc, so its absolutely clear we don't need anything else to identify them.

In fact the example is a cracker - I can use it in the future not only to explain why we don't need OID's, but also to show that identifiers can get very long, and that's why we make up things like SSN's to make life easier.

>
> --
> Reinier
Received on Sun Feb 17 2008 - 04:44:40 CET

Original text of this message