Re: Stupid Database Tricks

From: Marshall <marshall.spight_at_gmail.com>
Date: Tue, 05 Jun 2007 22:03:09 -0000
Message-ID: <1181080989.066372.12120_at_a26g2000pre.googlegroups.com>


On Jun 5, 12:47 pm, vldm10 <vld..._at_yahoo.com> wrote:
> On May 22, 11:59 pm, Marshall <marshall.spi..._at_gmail.com> wrote:
>
> > On May 22, 1:48 pm, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
>
> > > Every table will have a numeric id column, and this column will be the
> > > primary key.
>
> Regardless of what is intention here, it seems you and B. Badour
> misunderstand some important aspects of "one-column-key" as well as
> some aspects of "numeric". And of course key can be "alphabetic".
>
> > I don't know why, exactly, since it's not like it's the worst one
> > mentioned, but that one DRIVES ME CRAZY!
>
> This meditation is somehow paradoxical regarding that you
> misunderstand some basic things:
>
> > I hear people say this, and I want to say oh, I see: you're
> > just the stupidest freaking idiot ever, is that it? Of course
> > instead I say something about that being contraindicated.
> > My extra special favorite: there's a table that's *just* two
> > foreign keys to two different tables; a basic join table. The
> > pair (key1, key2) is unique of course.
>
> Here, you misunderstood - what is not primary key. Pair (key1, key2)
> is not primary key because it is not unique.

If the table has only two columns, as I specified, then it is necessarily unique, by the definition of relation. Even it it wasn't, as may be the case in badly executed SQL tables, there is still no value in adding an additional column which will contain no further information.

> Briefly your conclusion
> seems to arise from a misunderstanding concerning the nature of the
> simplest DB cases. It seems to me also, that this is source of your
> confusion regarding "two foreign keys".

You sure use that word "misunderstand" a lot.

Marshall Received on Wed Jun 06 2007 - 00:03:09 CEST

Original text of this message