What's the difference between a primary key and a unique
key?
Answer Posted / swapna
Both primary key and unique enforce 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.
| Is This Answer Correct ? | 16 Yes | 0 No |
Post New Answer View All Answers
How to create an index on a view?
What is the contrast between sql and mysql?
Do you know what are the restrictions applicable while creating views? : SQL Server Architecture
Do you know the different ddl commands in sql?
What is the maximum length of an alert name?
How can you stop stored procedures from recompiling?
What happens when converting big values to numeric data types?
What are the restrictions applicable while creating views? : SQL Server Architecture
What is the difference between an index and a unique index?
Why do we need different type of parameter?
What are the instances when triggers are appropriate?
Is it true, that there is no difference between a rule and a check constraint?
What is key attribute?
What are window functions in sql server?
How to configure and test odbc dsn settings?