Primary Key vs Candidate Key - Relational DBMS

301 Views Asked by At

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?

1

There are 1 best solutions below

1
Daniel On

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