What is the difference between UNIQUE CONSTRAINT and
PRIMARY KEY?

1. There is no difference.
2. A PRIMARY KEY cannot be declared on multiple columns.
3. A UNIQUE CONSTRAINT cannot be declared on multiple
columns.
4. A table can have multiple PRIMARY KEYS but only one
UNIQUE CONSTRAINT.
5. A table can have multiple UNIQUE CONSTRAINTs but only
one PRIMARY KEY.

Answer Posted / sunitha

yes, i agree with Rajesh ,primary key constraint doesn't allow null values but unique constraint allows null values.this is the main difference .

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does asenumerable execute the query?

594


Which are the different types of indexes in sql?

557


How do you use join?

524


Is primary key an index?

533


What is normalization? How many normalization forms are there?

552






How do I edit a stored procedure?

552


What are the types of join and explain each?

577


What is a unique key?

584


What are primary key and foreign key and how they work?

547


What is dense_rank?

536


What is an index in sql with example?

514


What does partition by mean in sql?

513


What are the different types of triggers?

589


Why procedure is used in sql?

531


What is the use of procedures?

539