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 / rajesh.m

There is no difference.
The One & only Difference is a UNIQUE would allow Null
Values where as The Primary Key Not.

Is This Answer Correct ?    15 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I install sql?

524


Define commit, rollback and savepoint?

578


Can you join views in sql?

544


explain advantages of innodb over myisam. : Sql dba

648


What is the advantage of nosql?

527






What is rownum in sql?

560


is mysql query is case sensitive? : Sql dba

565


What does subquery mean in sql?

542


Is left join same as inner join?

541


What is an exception in PL/SQL? What are the two types of exceptions?

629


What does the sign mean in sql?

507


Are subqueries better than joins?

536


How to execute a stored procedure?

565


Explain normalization and what are the advantages of it?

518


Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?

722