Eroxl's Notes
Candidate Key
aliases
Minimal Super Key

A candidate key is any super key which cannot be further reduced by removing attributes — that is, no proper subset of it is also a super key.

Formally, a set of attributes is a candidate key for a relation schema if:

  1. is a super key
  2. No proper subset is a super key ( is minimal).

Every relation has at least one candidate key. All candidate keys of a relation have the same property of uniquely identifying tuples — the choice of which one to designate as the primary key is a design decision.

Example

Consider a table Employee with the following attributes

  • EmployeeID: Unique ID assigned by the company
  • SSN: Social Security Number
  • Name: Name of the employee
  • Department: The department the employee works at

Some examples of it's candidate keys are the following sets:

  • {EmployeeID}: Is unique for every Employee
  • {SSN}: Like the ID is unique for every Employee

Conversely non-candidate keys which are still super keys are the following

  • {EmployeeID, SSN}: The SSN or EmployeeID are redundant keys to identify a record.
  • {EmployeeID, Name}: The Name attribute is redundant.