News for hackers. Stuff that matters.
Re:SQL X-to-Y by panda17 on Sunday November 01, 2020 @03:45PM (#24962359)
In general there can be more than one candidate key for a given relation (table). Only one candidate key is "primary", all others are "alternate".
Re:SQL X-to-Y by mulmen on Sunday November 01, 2020 @05:45PM (#24963218)
Thanks that makes sense.

Is this an industry term or are you just using it here to emphasize the difference?

Re:SQL X-to-Y by dspillett on Monday November 02, 2020 @05:05AM (#24966361)
I've seen alternate used in other places to refer to candidate keys that are not currently the primary key, though I'm fairly sure it isn't a defined standard term.
Re:SQL X-to-Y by panda17 on Tuesday November 03, 2020 @03:33PM (#24983663)
Regarding the "industry term", search:

   site:oracle.com "alternate key"

   site:microsoft.com "alternate key"

   site:ibm.com "alternate key"
Re:SQL X-to-Y by dspillett on Tuesday November 03, 2020 @07:47PM (#24985701)
"defined standard" !== "industry term", though I accept your point that it appears to be more common than I was thinking.

IIRC it wasn't introduced to me when learning databases academically which I was assuming to be a standards compliant environment, but that was quite some years ago so I may or may not R C...

Re:SQL X-to-Y by marcos100 on Monday November 02, 2020 @05:12AM (#24966408)
Industry term. But it is usually unknown to people who tend to use id as primary key for every table.
Re:SQL X-to-Y by mulmen on Monday November 02, 2020 @02:50PM (#24972348)
Do you mean synthetic keys rather than natural keys?