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 / vikneswaran

1) primary key don't allow null values but unique const
allow null values
2)we can declare primary key as multiple column. but table
should have one primary key
3)we can declare unique as multiple column. but table should
have one unique key
4) and 5)

in table we can create multiple column of primary key and
multiple column of unique. but only the restriction is in
table should have one primary key and one unique key .. if
it is neccessary.

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you pass hints to the sql processor?

530


How much ram can sql express use?

511


What do you understand by exception handling in pl/sql?

577


What is the most important ddl statements in sql are?

523


how many ways we can we find the current date using mysql? : Sql dba

616






Where not exists in sql?

503


How to create your own reports in sql developer?

542


What is sql dialect?

529


What does seeding a database mean?

531


Which join condition can be specified using on clause?

517


What is numeric function sql?

544


Why do we need cursor in pl sql?

649


What is having clause in sql?

529


What is faster join or subquery?

512


What is materialized view in sql?

465