What Is a Superkey?

A superkey is an attribute that can be used to identify a database record

A superkey is either a single or a combination of attributes that can be used to uniquely identify a database record. A table might have many combinations that create superkeys. 

Superkey Example

A table with the fields <Name>, <Age>, <SSN> and <Phone Extension>, for example, has many possible superkeys. Three superkeys are <SSN>, <Phone Extension, Name> and <SSN, Name>. 

NameAgeSSNPhone Ext.
Robert Jones43123-45-6789123
Beth Smith43234-56-7890456
Robert Jones18345-67-8901789

As you can see, the columns of <Name> and <Age> have multiple entries with identical information. While the <Phone Extension> column can be used to locate an individual, a phone extension can be changed.

Types of Superkeys

Of those listed in the table above, only <SSN> is a candidate key, which is a special subset of superkeys that use a minimal amount of attributes to uniquely identify a record. The other columns contain information not necessary to identify records.

The <SSN> can also be referred to as the minimal key or minimal superkey because it contains the least amount of information needed to identify an individual record. Along the same lines, a primary key can also be a superkey and a minimal key because it should uniquely pinpoint a record, and should rarely, if ever, change. 

If the table didn't contain a <SSN> column then an employer could create employee numbers in order to be able to identify individuals.

The new employee numbers would be called a surrogate primary key. This surrogate primary key would also serve as a superkey.