-2

My understanding is that the primary key is a randomly chosen candidate key from a theoretical perspective.

According to this definition

' Candidate Key – A Candidate Key can be any column or a combination of columns that can qualify as unique key in database. There can be multiple Candidate Keys in one table. Each Candidate Key can qualify as Primary Key.

Primary Key – A Primary Key is a column or a combination of columns that uniquely identify a record. Only one Candidate Key can be Primary Key.'

The sentences 'Each Candidate Key can qualify as Primary Key.' and 'Only one Candidate Key can be Primary Key.' only logically don't contradict if the primary key is chosen arbitrarily from the candidate keys. Is this correct?

What special properties does a Primary key have that a Candidate key does not?

Daniel
  • 379
  • 4
  • 15
  • Do you mean, in theory, or more generally? Also what has your further research shown? But what PKs are & are about is a faq. Before considering posting please read the manual & google any error message or many clear, concise & precise phrasings of your question/problem/goal, with & without your particular strings/names & site:stackoverflow.com & tags; read many answers. If you post a question, use one phrasing as title. Reflect your research. See [ask] & the voting arrow mouseover texts. Also when you quote something please give the source. – philipxy Apr 29 '20 at 07:58
  • Does this answer your question? [What is the difference between a candidate key and a primary key?](https://stackoverflow.com/questions/12813363/what-is-the-difference-between-a-candidate-key-and-a-primary-key) – philipxy Apr 29 '20 at 08:10
  • 1
    The quoted definitions of CK & PK are wrong. Beware, most [so]/[se] answers re the relational model are very poor. Eg: You quote [dba.se]. Eg: All answers at the duplicate link merit downvotes except [nvogel's](https://stackoverflow.com/a/12815171/3404097). Follow a published academic textbook on information modelling, the relational model & DB design. (Manuals for languages & tools to record & use designs are not such textbooks.) (Nor are wiki articles or web posts.) Ask 1 specific researched non-duplicate question where stuck. PS It is more accurate to say that "PK" is not part of theory. – philipxy Apr 29 '20 at 08:40
  • @philipxy you have exactly answered my question. – Daniel Apr 29 '20 at 10:08

1 Answers1

-1

The quoted definitions of CK & PK are wrong. Beware, most Stack Overflow/Stack Exchange answers re the relational model are very poor. Eg: You quote Database Administrators. Eg: All answers at the duplicate link merit downvotes except nvogel's. Follow a published academic textbook on information modelling, the relational model & DB design. (Manuals for languages & tools to record & use designs are not such textbooks.) (Nor are wiki articles or web posts.) Ask 1 specific researched non-duplicate question where stuck. PS It is more accurate to say that "PK" is not part of theory. – philipxy

Daniel
  • 379
  • 4
  • 15
  • Your question is a duplicate, so it should be closed, not answered. PS An answer ideally justifies & reallly should when against extant SO/SE voting. I only left a comment, although I told you how this could be justfied--refer to a (good) published academic textbook. Without justification this is not a good answer--even if it is a reasonable comment. Also it doesn't actually answer your question, it points to an answer. (Actually your post has multiple questions.) That answer--as I said, like all answers--would be better justified--eg by referencing the literature or a good textbook itself. – philipxy Apr 29 '20 at 11:24