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

#### nancyphilips Profile Answers by nancyphilips Questions by nancyphilips

• May 8th, 2007

A candidate key is one which can be used as primary key that is not null and unique constraint both holding true. In short all primary keys are definitely candidate keys. That is one of the candidate keys is chosen as primary key.

#### ravi

• 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

#### SUKANYA

• 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.

#### V.Lijina

• 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

#### srikanth.cherukupalli Profile Answers by srikanth.cherukupalli

• Jan 12th, 2012

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.

#### 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.

Send   Reset