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

Primary Keys

Coloured Line

[Top]

Coloured Line

Definitions

Primary Key  An attribute or group of attributes used to uniquely identify the tuples of a relation.

(Benynon-Davies 2004:592)


A subset (often one) of the attributes is chosen as the primary key, that is, an identifier of rows. No two rows will have the same value of this key.

(Carter 1995:77)


Primary key  The candidate key that is selected to identify tuples uniquely within the relation.

(Connolly & Begg 2005:79)


The primary key is a unique identifier of the table - that is, a column or column combination with the property that, at any given time, no two rows of the table contain the same value in that column or column combination.

(Date 1995:79)


For any relation (table) one candidate key will be selected as the primary key.

(Eaglestone 1991:31)


It is common to designate one of the candidate keys as the primary key of the relation. This is the candidate key which is used to identify tuples in the  relation.

(Elmasri & Navathe 2004:135)


If a relation has several keys, they are referred to as candidate keys. However, one key is often designated as the primary key.

(Kifer et al. 2005:42)


Primary key  A candidate key selected to uniquely identify all other attributes in any given row. Cannot contain null entries.

(Rob & Coronel 2002:68)


A primary key is a single field or combination of fields that uniquely defines a record. None of the fields that are part of the primary key can contain a null value. A table can have only one primary key.

Note: In Oracle, a primary key can not contain more than 32 columns.

A primary key can be defined in either a CREATE TABLE statement or an ALTER TABLE statement.

Tech on the Net


Primary key refers to an attribute or attributes that uniquely identify one and only one occurrence of an entity.

(Whitten et al. 1994:510)


In the relational model of data, a primary key is a candidate key chosen as the main method of uniquely identifying a tuple in a relation.

Wikipedia

[Top]

Coloured Line

Things to Remember About Primary Keys

A primary key is a special case of a candidate key.

A primary key does not stop being a candidate key when it is selected as the primary key.

If I have n candidate keys, and I chose one to be the primary key, I then have:

Alternate keys are candidate keys not chosen as primary keys.

Coloured Line

There is an important difference between a primary key having more than one attribute (possible) and a relation having more than one primary key (impossible).

Coloured Line

A primary key is selected so that we can make sure that each tuple (row) has some unique identifier. The attributes which form the primary key are not allowed to have no value at all. (No value is called a null value.) Primary key values are used to cross-reference tuples (rows) in one relation (table) with tuples in another in order to represent the relationship between the objects about which the data represents information.

(Eaglestone 1991:32)


[Top]

Coloured Line

Carol Edmondson   <carol@cs.anu.edu.au>
URL: http://computer/%7ECarol.Edmondson/theory/PrimaryKeys.shtml
Last modified: 21 November 2006 13:39:45 EST