Re: What is the use of a primary key?

From: --CELKO-- <71062.1056_at_compuserve.com>
Date: 29 Nov 2002 14:30:38 -0800
Message-ID: <c0d87ec0.0211291430.60972adb_at_posting.google.com>


>> the candidate keys must be defined as not null and unique (just the
same that with the primary key), so... what's the difference? <<

None. When Dr. Codd first defined his model, he was still under the influence of the file model of data. A sequential file must have a sorted order on a subset of it columns to work -- merging and searching without it are impossible for practical purposes.

He later admited that this was an error and that all keys are the same.

But he was too late! SQL had picked up the idea of a PRIMARY KEY, and given it special properities - it is automatically NOT NULL, it is the default target of a REFERENCES clause and some products store index on it differently. Received on Fri Nov 29 2002 - 23:30:38 CET

Original text of this message