Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/lsp4you/public_html/connect.php on line 2 LSP4YOU - Learner's Support Publications

Super Keys and Candidate Keys

Super Keys:
A super key is an attribute or set of attributes used to identify the records uniquely in a relation.
For example, in the relation PERSON, PERSON_ID is a super key since PERSON_ID is unique for each person. Similarly, (PERSON_ID, AGE) and (PERSON_ID, NAME) are also super keys.

Candidate Keys:
Candidate keys are minimal super keys, i.e. such a key contains no extraneous attributes.
An attribute is called extraneous if even after removing it from the key, makes the remaining attributes still has the properties of a key. Properties of candidate keys:
  • must be unique,
  • it can not null (value must exist),
  • a minimal set of attributes.

  • A relation can have more than one candidate keys and one of them can be chosen as a primary key and the others are called alternate keys.