What is the difference between a candidate key and a primary key?

Celeritas picture Celeritas · Oct 10, 2012 · Viewed 179.6k times · Source

Is it that a primary key is the selected candidate key chosen for a given table?

Answer

John Woo picture John Woo · Oct 10, 2012

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.

More on this link with example