| [Relational Theory] | [Carol's HomePage] |
![]()
![]()
| Superkey | An attribute, or set of attributes, that uniquely identifies a tuple within a relation. |
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.
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.
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.
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.
... a set of attributes in S that contains a key is called a superkey of S.
| Superkey | An attribute (or combination of attributes) that uniquely identifies each entity in a table. |
A set of attributes that contains a key is called a superkey, short for "superset of a key." Thus, every key is a superkey.
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.
![]()
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
![]()
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}
![]()
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.
![]()
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.
![]()
| Q | In what way are superkeys and candidate keys the same? |
| A | They both uniquely identify tuples in a relation. |
| Q | In what way are superkeys and candidate keys different? |
| A |
A superkey is a set of attributes which uniquely identifies tuples in a relation.
|
![]()
|
URL: http://leven.cis.utas.edu.au/users/cae/my_websites/theory/Superkeys.shtml
Last modified: 02 November 2006 22:12:40 EST |