C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers


10,705 users

What's the difference between a primary key and a unique key?

0 votes
asked by john Guru (27,140 points)

1 Answer

0 votes
Both primary key and unique key enforces uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn't allow NULLs, but unique key allows one NULL only.
answered by sara Guru (24,570 points)

Related questions

0 votes
2 answers 59 views
0 votes
1 answer 20 views
20 views asked by sunny Expert (11,410 points)
+2 votes
2 answers 5,255 views
0 votes
1 answer 26 views
0 votes
1 answer 28 views