View Single Post
  #17  
Old September 26th, 2005, 08:36 AM
external usenet poster
 
Posts: n/a
Default


BruceM wrote:
What would you do to guarantee uniqueness in a Contacts table or some such
involving names and addresses


For a Contacts table, last_name, first_name and postal_address makes a
fine natural key (assuming you can uniquely identify addresses g).
The chances that someone with the same name living at the same address
*is* the same person are very high. If they are different, then the
chances of them being related, and hence being in contact with the
intended person themselves, are high again. Adding an autonumber to
this Contacts table is not going to help you resolve this situation.
You'd have to tell them they are ContactID=1 and every time you
contacted them you'd have to check their ContactID to ensure you
weren't addressing their eponymous grandfather... unless they'd
divulged their ContactID. Anyhow, in doing so you'd have to 'expose'
the autonumber value and even the regulars who advocate autonumbers
will tell you this is taboo. Keys are all about ... what's the word
here? ... trust, security, etc. For a Contacts table, name and address
are good enough because they consequence of getting the wrong person
aren't all that bad (hey, maybe the granddad will buy your product
g). Higher levels of trust/security are requires different
information to be stored/issued: pin numbers, favourite question and
answer, mother's maiden name, 'An email has been sent...reply or follow
the link...', a personal appearance plus ID, photo ID, fingerprints,
retina scan, etc. Autonumber does not help identify an entity in
reality (in the data model), it can only be used internally (in the
database).

in light of the fact that names and addresses
are subject to change?


Who says a key can't change? What do you think ON UPDATE CASCADE is
for?

Ads