thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Intermediate

Candidate Key

Any minimal set of columns that could uniquely identify every row; one is chosen as the primary key.

Definition

A candidate key is a superkey with no unnecessary columns. A table may have several candidate keys, such as EmployeeID and NationalID. The one selected becomes the primary key and the rest are alternate keys, usually enforced with UNIQUE constraints.

Example

In Employees, both EmpID and Email are candidate keys; EmpID is chosen as the primary key.

Exam tip

Know the hierarchy: superkey (any unique set) > candidate key (minimal superkey) > primary key (the chosen candidate).

Related terms