Re:Do you make these 5 database design mistakes?
by Tsagadai on Monday January 02, 2012 @07:43PM
(#3418096)
Phone numbers are not unique identifiers. In several regions around the world, phone numbers are reused. Please keep this in mind because it is very short sighted to say you will never expand globally.
[ Parent
| on HN ]
Re:Do you make these 5 database design mistakes?
by ListMistress on Monday January 02, 2012 @09:12PM
(#3418325)
I agree, neither phone numbers nor social insurance numbers are unique.
But the issue is with storing them in numeric datatypes. They aren't guaranteed to be unique forever (and indeed, are alphanumeric in many jurisdictions) and the leading zero problem is a killer when you go to reconstitute them, both for performance and for logic reasons. Same goes for US ZipCodes.
This is why I have to have a very strong technical reason to make a non-math column numeric, especially with externally set data (like SSNs, SINs, Account codes, etc.) The people who set them could just start adding letters or symbols...and this isn't rare.
Re:Do you make these 5 database design mistakes?
by coolgeek on Monday January 02, 2012 @09:49PM
(#3418397)
Indeed, Medicare numbers are usually the SSN with a letter appended
Re:Do you make these 5 database design mistakes?
by kls on Tuesday January 03, 2012 @12:32AM
(#3418733)
Sure perhaps I should not have used the term "unique" but they are identifiers, they identify how to contact a certain individual based on a numeric sequence. Same with SS numbers they identify a living person. I would never use either as a unique key in my database but I am not a natural key person for the most part. I tend to like a uniquely generated key to serve as a surrogate for my unique primary identifier.