Saturday, May 1, 2010

Candidate Key

0 comments
In the relational model of databases, a candidate key of a relation is a minimal superkey for that relation; that is, a set of attributes such that


1. the relation does not have two distinct tuples with the same values for these attributes (which means that the set of attributes is a superkey)

2.there is no proper subset of these attributes for which
(1) holds (which means that the set is minimal).


Since a relation contains no duplicate tuples, the set of all its attributes is a superkey if NULL values are not used. It follows that every relation will have at least one candidate key.



The candidate keys of a relation tell us all the possible ways we can identify its tuples. As such they are an important concept for the design database schema.






0 comments: