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

Candidate Keys

Coloured Line

[Top]

Coloured Line

Definitions

Candidate Key  An attribute or group of attributes capable of acting a primary key.

(Benynon-Davies 2004:582)


Candidate key  A superkey such that no proper subset is a superkey within the relation.

(Connolly & Begg 2005:78)

Let R be a relation. Then a candidate key for R is a subset of the attributes of R, say K, such that:

  1. Uniqueness property:
    No two distinct tuples of R have the same value for K.

  2. Irreducibility property:
    No proper subset of K has the uniqueness property.

(Date 1995:112)


A candidate key is a minimal subset of attributes in a relation which uniquely identifies each tuple in the relation.

Edmondson


If a relation schema has more than one key, each is called a candidate key.

(Elmasri & Navathe 2004:314)


If a relation has several keys, they are referred to as candidate keys.

(Kifer et al. 2005:42)


The various keys of a relation are often known as candidate keys; the name implies a selection process whereby one of the candidate keys will be designated as the primary key.

(O'Neil 1994)


A candidate key can be described as a superkey without redundancies.

(Rob & Coronel 2002: 65)

In the relational model a candidate key of a relation is a set of attributes of that relation such that (1) in all instances of that relation it holds that there are no two distinct tuples with the same values for these attributes and (2) there is not a proper subset for which (1) holds. Since a superkey is defined as a set of attributes for which (1) holds we can also define candidate keys as minimal superkeys, i.e., superkeys of which no proper subset is also a superkey.

Wikipedia

[Top]

Coloured Line

Things to Remember About Candidate Keys

Every relation (table) has at least one candidate key; this must be the case since duplicate tuples (rows) are not allowed.

(Eaglestone 1991:112)


The importance of candidate keys is that they tell us how we can identify individual tuples in instances of a relation. As such they are one of the most important types of database constraints that should be specified when designing a database schema. Since an instance of a relation is always a set it holds that every relation will have at least one candidate key. Since in some RDBMSs tables may also represent multisets (which strictly means these DBMSs are not relational) it is an important design-rule to specify explicitly at least one candidate key for each relation. For practical reasons RDBMSs usually require that for each relation one of its candidate keys is declared as the primary key, which means that it is considered as the preferred way to identify individual tuples. Foreign keys, for example, are usually required to arrive in such a primary key and not in any other of the candidate keys.

Wikipedia


[Top]

Coloured Line

Carol Edmondson   <carol@cs.anu.edu.au>
URL: http://computer/%7ECarol.Edmondson/theory/CandidateKeys.shtml
Last modified: 10 November 2006 19:01:40 EST