Re: Artificial Primary keys

From: --CELKO-- <71062.1056_at_compuserve.com>
Date: 4 Feb 2002 08:02:27 -0800
Message-ID: <c0d87ec0.0202040802.78106b93_at_posting.google.com>


>> No, it's artificial. There's an arbitrary coding scheme that links
the
numeric values in the ISBN to real-world data. There's no inherent connection between the number 56592 and the publisher it identifies. <<

The test for a natural key is one that "occurs in nature" -- meaning the reality that the database is supposed to model. Physical reality is only one thing we might model -- how many accounting systems are total works of fiction <G>?

ISBN's come from a trusted outside party and are verified by everyone in the book trade in the whole world. The book trade is the external reality. The iSBN is a natural key in that reality.

Now if you make up your own SKU code for your bookstore, then you have an artifacial key. You can still put come checks on this key and verify it. It is simply useless outside your store in the reality you are modeling. A surrogate key would be a GUID or IDENTITY or ROWID or hashing or whatever the engine creates and nobody should ever access it because it is for system use only. Received on Mon Feb 04 2002 - 17:02:27 CET

Original text of this message