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 |