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

Answer Posted / srinivas

Primary key is a combination of unique+not null+cluster
index and it will not allow any duplicate values, null
values, and it's data will be arranged in ascending order
due to clustered index. Only one primary key is allowed
per table.

Unique key is a key which will not accept any duplicate
values, but it will accept one null value. We can place
any number of unique keys per table.

Is This Answer Correct ?    17 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to list all columns in a table using odbc_columns()?

631


Explain about builtinadministrator?

678


Write a SQL query to delete a table?

746


What is difference between count (*) and count 1?

587


what is the difference between count(*) and count(1) ?

711






how many clustered indexes can be created on a table? : Sql server database administration

659


What is simple indexing method?

666


How to delete all rows with truncate table statement in ms sql server?

577


Difference between LEN() and DATALENGTH() in sql server ?

691


What is query parameter in ssrs?

122


How do you run a trace?

610


What is the difference between value type and reference type?

627


What are the rendering extensions of ssrs?

113


What is a unique index?

605


What options are available to audit login activity? : sql server security

724