Candidate key in DBMS

Rumman Ansari   Software Engineer   2023-03-23   6004 Share
☰ Table of Contents

Table of Content:


A candidate key is an attribute or set of an attribute which can uniquely identify a tuple. The remaining attributes except for primary key are considered as a candidate key. The candidate keys are as strong as the primary key.

Another way we can say: A super key with no redundant attribute is known as candidate key. Candidate keys are selected from the set of super keys, the only thing we take care while selecting candidate key is that the candidate key should not have any redundant attributes. That’s the reason they are also termed as minimal super key.

For example: In the EMPLOYEE table, id is best suited for the primary key. Rest of the attributes like SSN, Passport_Number, and License_Number, etc. are considered as a candidate key.

Candidate keys are defined as the minimal set of fields which can uniquely identify each record in a table. It is an attribute or a set of attributes that can act as a Primary Key for a table to uniquely identify each record in that table. There can be more than one candidate key.

Points to Note regarding Primary Key

  • A candiate key can never be NULL or empty. And its value should be unique.
  • There can be more than one candidate keys for a table.
  • A candidate key can be a combination of more than one columns(attributes).

Secondary or Alternative key

The candidate key which are not selected as primary key are known as secondary keys or alternative keys.