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

3,749 questions

4,049 answers

114 comments

10,705 users

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

0 votes
20 views
asked Mar 6, 2014 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 Mar 6, 2014 by sara Guru (24,570 points)

Related questions

0 votes
2 answers 57 views
0 votes
1 answer 19 views
19 views asked Mar 7, 2014 by sunny Expert (11,410 points)
+2 votes
2 answers 5,250 views
5,250 views asked Jun 10, 2010 by anonymous
0 votes
1 answer 25 views
0 votes
1 answer 27 views
27 views asked Mar 6, 2014 by john Guru (27,140 points)
...