Forum : What is difference between candidate key and primary key?
Brief description  about Online courses   join in Online courses
View Balu  Prasad 's Profile

What is difference between candidate key and primary key?

Hi sir,

can you explain what is the difference between candidate key and primary key?
Asked by Balu Prasad | Nov 23, 2009 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Balu Prasad,

Any attribute that is uniquely identify a row in a table is candidate key(primary key) for the table. We select one of the candidate key as Primary key. All candidate keys which are not chosen as primary key are Alternate keys.

The key which uniquely identify the rows of the table and which is made up of more than one attribute is called Composite key. Generally a candidate key becomes the primary key of the table. If the table has more than one candidate key one of them will become the primary key and the rest are called alternate keys
Nov 23, 2009