Quote:
|
Originally Posted by andrewst
Apart from meaning your table now had two columns instead of one, what purpose would that ID column serve? Answer: none. The state code itself is unique and will serve as a perfectly good, natural, primary key. Stick with your one column - or perhaps more usefully, add a description column that tells the user that 'NY' means 'New York' etc.
|
I think that I'm probably genetically averse to the use of natural keys, but that aversion has come from experience... Things that "can't" change still seem to change on me, and at the worst possible times.
The population of California might decide to rename the state as "Ahnold-Stadt" and legislate the use of the abbreviation AS (they've actually done much weirder thing than that). This would cause great consternation, considering that Arkansas already used the state code of AS.
A natural key solution has no defense whatsoever against this kind of user-induced change. The problem is legislative, so there is no reasoning with it... You simply have to comply.
From a logical perspective, Tony has a good point and a natural key makes good sense. It still makes me nervous, since what is logical and what the real world requires are often two different things in my experience!
-PatP