Re: Primary key on one or two fields

From: --CELKO-- <joe.celko_at_northface.edu>
Date: 12 Aug 2003 17:01:40 -0700
Message-ID: <a264e7ea.0308121601.7bb2a9b9_at_posting.google.com>


>> Nitpick: primary key's can't be null, for good reason. Substituting
a default value doesn't improve the situation. <<

I agree that I would much rather have an actual value in a key, but very often there are reasonable defaults that carry information.

Example: the ICD codes (International Classification of Disease) have both 000.000 and 999.999, with 000.000 as a natural default. 000.000 is a missing value marker that means "Undiagnosed" and 999.999 is a missing value marker that means "We tried to diagnose it, but don't know what the heck is killing you!"

The use of "vacant" or "to be determined" for an open job position is menaingful; "refund" for an inventory item that has gone out of stock and the default is fired by a ON DELETE SET DEFAULT action, etc. Received on Wed Aug 13 2003 - 02:01:40 CEST

Original text of this message