Discussion board
What is difference between candidate key and primary key?
By Balu Prasad
Hi sir,

can you explain what is the difference between candidate key and primary key?
Reply
Post   Reset
Teacher SiliconIndia replied to Balu Prasad Monday, November 23, 2009
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