How to Identify a Database Record Using a Superkey

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

Employee Spreadsheet
rjp85 / Getty Images

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>. 

Name Age SSN Phone Ext.
Robert Jones 43 123-45-6789 123
Beth Smith 43 234-56-7890 456
Robert Jones 18 345-67-8901 789

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.