What Is a Candidate Key?

In a database, each table may have one or more candidate keys

Woman works at computer
Reza Estakhrian/The Image Bank/Getty Images

A candidate key is a combination of attributes that can be uniquely used to identify a database record without referring to any other data. Each table may have one or more candidate . One of these candidate keys is selected as the table primary key. A table contains only one primary key, but it can contain several candidate keys. If a candidate key is composed of two or more columns, then it's called a composite key.

Properties of a Candidate Key

All candidate keys have some common properties. One of the properties is that for the lifetime of the candidate key, the attribute used for identification must remain the same. Another is that the value cannot be null. Lastly, the candidate key must be unique.

For example, to uniquely identify each employee this company is using the employee's Social Security Number. As you can see, there are people with the same first names, last names, and position, but no two people ever have the same Social Security Number. 

Social Security NumberFirst NameLast NamePosition
345-67-890Sandra BealManager

Some other common candidate keys are employee numbers, bank account numbers and ISBN numbers on the back of books.