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


Please Help Members By Posting Answers For Below Questions

Can multiple columns be used in sql group by clause in ms sql server?

648


What is the fillfactor concept in indexes?

623


ow to bring suspect mode datbase online from scratch

1497


We are updating a field in sql and alter the row also.after giving the commit command the system is crashed.what will happen to the commands given,whether it will update and alter the table or not?

993


What is an indice?

667






You schedule a job to run every minute what will happen if the first job runs more than 1 min? Will the second instance of the job start?

694


How many null values we can have in a unique key field in sql server?

639


When would you use it?

676


What are unicode character string data types in ms sql server?

693


How to configure odbc dsn with different port numbers?

664


How to find out what is the default collation in a database?

715


Mention what are the core components of ssrs?

234


Define self join in sql server joins?

595


What are different types of views?

629


How retrieve field names from the table in SQL through JAVA code?

1476