What is the difference between a candidate key and a primary key?

Questions by lokaiah.p

Showing Answers 1 - 6 of 6 Answers


  • May 12th, 2007

Candidate key is a Unique Key and it can be used to find out any purticular Tuple(row) in a table..
a Primary key is also a Candidate Key...

But these are the diff..
1)on a table we can have only 1 primary key but 'N' number of unique keys.
2)Unique key can be null but not a Primary key


  • Sep 16th, 2011

Primary key-Primary is assign to that column whose values should be unique
Example-- roll no column in a class table there can be 2 person with same name so this column cannot be primary key because all value should be unique but the roll will be given unique to every student.

Unique key-The logic is same the value should be unique but the vale can be null but in primary key the value cannot be null.

Candidate key-There will be possibilities where 2 column may be unique but we can assign only one primary key so the other column is the candidate key as it can also be the primary key.

  Was this answer useful?  Yes


  • Sep 28th, 2011

The main purpose of candidate key : from candidate key the user can choose the best primary key,we can have multiple candidate key but only one primary key

  Was this answer useful?  Yes

Primary key defines the uniqueness of a row. there should be no null value in primary key.

The keys which are opt for primary key known as candidate keys. In a table candidate keys are the candidates for the primary key. Hence the selected one is called primary key and the remaining ones are called as alternate keys.

  Was this answer useful?  Yes

ashok panguluri

  • Feb 11th, 2012

Primary key: The key which is unique and not allow the null values nothing but primary key. Each table contain only one primary key.

Candidate key: The key which is opt for the primary key is nothing but candidate key, the table can contain number of candidate key as per requirement.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions