Click here to Skip to main content
15,905,971 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello every one,
i am getting confused between the candidate key and unique key,its use and implementation
please help me!!!!




Regards
Priyanka Bhagwat
Posted
Comments
Sergey Alexandrovich Kryukov 15-Feb-14 22:43pm    
What do you mean by "difference"? Did you try just to read about those concepts? And perhaps find examples? I bet you could find millions of them...
—SA
Priyanka Bhagwat 15-Feb-14 22:46pm    
yes i do read the articles..but i am getting confused between the unique key and candidate key...
not able to get the scenarios whereto implement what..plz help me

 
Share this answer
 
Candidate Key is a column or combination of columns, which can be a Primary key for the Table.
There may be multiple Candidate Keys In a Table.

Any Candidate Key can be a Primary Key.

Unique Key is a column which has unique value for each row, but it also allow nulls (Primary Key doesn't).

Any confusions, feel free to ask.

Read - SQL SERVER – Difference Between Candidate Keys and Primary Key[^]
 
Share this answer
 
v2
Candidate key is a minimal (i.e. irreducible) key, unique key is a pleonasm, and primary key is an obsoleted concept still surviving from the days when people thought it possible for one key to be "more unique" than any of the others.

A quite excellent information is given regarding your problem here[^].

-KR
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900