in Databases
1,001 views
2 votes
2 votes
Explain the distinctions among the terms primary key, candidate key, and
superkey.
in Databases
1.0k views

2 Answers

4 votes
4 votes
Best answer
  • Candidate Key: The minimal set of attribute which can uniquely identify a tuple is known as candidate key.
  • Super Key: The set of attributes which can uniquely identify a tuple is known as Super Key. 
  • primary key: The PRIMARY KEY constraint uniquely identifies each record in a table.

                           Primary keys must contain UNIQUE values, and cannot contain NULL values.

 

selected by
0 votes
0 votes
Candidate key a attribute or set of attribute which is minimal and provide unique identification.

and set of all candidate key we choose appropriate key which is primary key . also note that all primary key is candidate key but all candidate key need not primary key.

in case of super key it also provide unique identification but it may be redundant or not minimal.

For ex-: suppose we have a relation with attribute A,B,C,D, in this AB can be a primary key and candidate key.

but ABC will be super key.

Related questions