• RonKyle (2/12/2014)


    My favourite example, a table of Marriages with exactly two attributes: Husband and Wife. Both attributes are candidate keys because clearly we don't want to allow the same person to have more than one marriage simultaneously. So which key is "primary", husband or wife? Does it make any real difference if I pick either or even both of those as primary keys?

    It would certainly seem to make a real difference. If the husband is the primary key, wives could still have multiple husbands, and vice versa.

    No because I already stated that both Husband and Wife are keys (i.e. candidate keys). Enforcing all the desired keys of a table is of course extremely important - much more important than choosing one of them to be "primary". The point of the example is that it doesn't make any difference which key you call primary. It shouldn't even make any difference if you call both of them primary. Whatever distinction you choose to ascribe to the primary key could in principle apply equally well to any or all other keys so the form, function and intended meaning of the table isn't altered by that essentially arbitrary choice.