State differences between Primary key and Unique Key?

 Posted by vishalneeraj-24503 on 3/6/2014 | Category: Sql Server Interview questions | Views: 558 | Points: 40
Answer:

As there are some similarities between Primary key and Unique Key but there are some differences between both.The differences are listed below:-

-> Primary Key does not allow duplicates where as Unique key allows only one NULL.
-> A table can have only one Primary Key whereas a table can have multiple Unique Keys.
-> By default Primary Key creates a Unique Clustered Index on the table whereas by default Unique Key creates a Unique Non-Clustered Index on the table.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response