T
, with Head(T)=A1…An
.
A key for the table T
, sometimes called a candidate key, is a set of attributes, K=Ai1…Aik
, with two properties:
u
and v
are distinct tuples of T
, then by designer intention u[K]
≠v[K]
; that is, there will always exist at least one column, Aim
, in the set of columns K
such that u[Aim]
≠v[Aim]
.
H
of K
has the Property 1.
Example (Table Key)
Calculate the keys of T from a given content:
†Note that this example is to explain the concept of a key, instead of trying to find the keys from a table content. |
|
S
of attributes can be a key if it includes D
, since D
gives no help in distinguishing rows of T
.
T
are distinguished by each of AB
, AC
, and BC
.
AB
, AC
, or BC
.
T
is the candidate key chosen by the database designer to uniquely identify specific rows of T
.
“A room without books is like a body without a soul.” ― Marcus Tullius Cicero |