Eroxl's Notes
Super Key

A super key is a set of one or more attributes in a schema that uniquely identifies a tuple.

Formally, a set of attributes is a super key for a relation schema if for every valid instance :

Equivalently, is a super key if holds and the closure contains all attributes of the schema.

Every relation always contains at least one super key: the trivial key, which is the set of all its attributes.

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 super keys are the following sets:

  • {EmployeeID}: Is unique for every Employee
  • {SSN}: Like the ID is unique for every Employee
  • {EmployeeID, Name}: Via reflexivity as Name is redundant.
  • {EmployeeID, SSN, Name, Department}: The trivial super key which already contains all columns.