Candidate Key

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 (i.e. rows or records in common database language) 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).

The constituent attributes are called prime attributes. Conversely, an attribute that does not occur in ANY candidate key is called a non-prime attribute.

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 of database schema.

Read more about Candidate Key:  Example, Determining Candidate Keys

Famous quotes containing the words candidate and/or key:

    We have fought too much rhetoric and red tape to be lulled and comforted by a paid political advertisement showing a candidate tossing his grandchild in the air while a disembodied voice espouses “family values” in the background.
    Bernice Weissbourd (20th century)

    The key to the age may be this, or that, or the other, as the young orators describe; the key to all ages is—Imbecility: imbecility in the vast majority of men, at all times, and even in heroes, in all but certain eminent moments: victims of gravity, customs and fear. This gives force to the strong,—that the multitude have no habit of self-reliance or original action.
    Ralph Waldo Emerson (1803–1882)