Re: Primary key and requirement

From: Marshall Spight <mspight_at_dnai.com>
Date: Sun, 20 Apr 2003 04:03:02 GMT
Message-ID: <WZooa.558744$S_4.625394_at_rwcrnsc53>


"Ken" <ken_at_ken.com> wrote in message news:pan.2003.04.20.00.00.38.890000_at_ken.com...

>

> I have a simple, yet fundamental database design question.
> Is it considered poor database design for every table
> to NOT have a primary key?

Uh, yeah, pretty much.

Every table needs to have *some* unique constraint, or else it will permit duplicates. If the table allows dupes, it's not a set, and so it'll behave in many screwy ways. I consider it a bug in SQL that it allows the specification of tables without at least one unique constraint.

Note that the concept of a primary key is one that doesn't appear in database theory. A table may have more than one candidate key (that is, minimal set of columns with the uniqueness property) but they all have the same status. It may be convenient to designate one of them as "primary" but it has no meaning per se for a key to be "primary" or not.

Marshall Received on Sun Apr 20 2003 - 06:03:02 CEST

Original text of this message