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

Why do we use procedures?

519


What are the commands used in sql?

527


Which version of sql do I have?

562


what is 'mysqldump'? : Sql dba

573


What are the different types of database management systems?

532






what is subquery? : Sql dba

569


What is normalization in sql?

529


Why should I use postgresql?

566


What are the various restrictions imposed on view in terms of dml?

522


How you can copy a file to file content and file to pl/sql table in advance pl/sql?

620


Can we join tables without foreign key?

520


What is mutating error?

509


Can we create table inside stored procedure?

532


What is the use of partition by in sql?

517


What is sql key?

523