Both Primary Key and Candidate key are used to get records from tables. These keys are also used to create relationship between tables. Primary Key and Candidate key both are used to identify records uniquely in a table.
Following are the important differences between Primary Key and Candidate key.
|Sr. No.||Key||Primary Key||Candidate key|
|1||Definition||Primary Key is a unique and non-null key which identify a record uniquely in table. A table can have only one primary key.||Candidate key is also a unique key to identify a record uniquely in a table but a table can have multiple candidate keys.|
|2||Null||Primary key column value can not be null.||Candidate key column can have null value.|
|3||Objective||Primary key is most important part of any relation or table.||Candidate key signifies as which key can be used as Primary Key.|
|4||Use||Primary Key is a candidate key.||Candidate key may or may not be a primary key.|