Super keys of a relation can have extra attributes. Candidate keys are minimal super key, i.e. such a key have no extraneous attribute. An attribute is known as extraneous if even after removing it from the key, create the remaining attributes still has the properties of a key.
The following properties must be satisfied by the candidate keys:
- A candidate key's value must exist. It cannot be null. (This is also known as entity integrity rule)
- A candidate key has to be unique.
- A candidate key is a smallest set of attributes.
- The value of a candidate key has to be stable. Its value cannot change outside the control of the system.
A relation can have more than single candidate keys and one of them can be chosen as a primary key.
For instance, in the relation PERSON the two likely candidate keys are PERSON- ID and NAME (assuming unique names in the table). PERSON-ID may be taken as the primary key.