[Relational Theory] [Carol's HomePage]
Coloured Line

Superkeys

Coloured Line

[Top]

Coloured Line

Definitions

Superkey  An attribute, or set of attributes, that uniquely identifies a tuple within a relation.

(Connolly & Begg 2005:78)


A superkey of a relation is a subset of attributes in the relation, such that each value taken by the subset uniquely identifies a tuple in the relation.

Edmondson


Given a relation R and S, a subset of the attributes in R, S is a superkey of R if at least one candidate key of R is a subset of S.

Edmondson


A superkey SK specifies a uniqueness constraint that no two distinct tuples in a state r of R can have the same value for SK. Every relation has at least one default superkey - the set of all its attributes.

(Elmasri & Navathe 2004:134)


A superkey of relation R is a set of attributes X such that X → Y where y is any attribute of R. It is of course possible that a subset X′ of attributes of X may also be a superkey.

(Hawryszkiewycz 1984:25)


... a set of attributes in S that contains a key is called a superkey of S.

(Kifer et al. 2005:42)


Superkey  An attribute (or combination of attributes) that uniquely identifies each entity in a table.

(Rob & Coronel 2002:68)


A set of attributes that contains a key is called a superkey, short for "superset of a key." Thus, every key is a superkey.

(Ullman & Widom 1997:122)


A superkey is defined in the relational model as a set of attributes of a relation for which it holds that in all instances of the relation there are no two distinct tuples that have the same values for the attributes in this set. Equivalently a superkey can also be defined as those sets of attributes of a relation upon which all attributes of the relation are functionally dependent.

Wikipedia

[Top]

Coloured Line

Examples

Given a relation R (x, y, z)

S {x, y, z} is a superkey for R

If we cannot find a proper subset of S, S1, such that

S1 → R′
where R′ is the set of the attributes in R

then S is a candidate key for R


Coloured Line


Given a relation R (a, b, c)
which has one candidate key {a}

The superkeys of R are

{a} {a, b} {a, c} {a, b, c}

[Top]

Coloured Line

Things to Remember About Superkeys

The "super" in "superkey" means "over" or "above".
The "super" in "superkey" does not mean "really good".

A superkey is not better than a candidate key.

Coloured Line

All candidate keys are superkeys.
Not all superkeys are candidate keys.

A candidate key is a subset of at least one superkey.
A superkey contains at least one candidate key.

[Top]

Coloured Line

Q & A

In what way are superkeys and candidate keys the same?
They both uniquely identify tuples in a relation.

In what way are superkeys and candidate keys different?

A superkey is a set of attributes which uniquely identifies tuples in a relation.
A candidate key is a minimal set of attributes which uniquely identifies tuples in a relation.


[Top]

Coloured Line

Carol Edmondson   <carol@cs.anu.edu.au>
URL: http://computer/%7ECarol.Edmondson/theory/Superkeys.shtml
Last modified: 02 November 2006 22:12:39 EST