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
How can I speed up sql query?
Can we insert data into materialized view?
What is primary key and unique key?
Explain what is a database?
Explain the advantages and disadvantages of stored procedure?
Does pdo prevent sql injection?
What is cte?
What is compilation error in pl sql?
What is materialized view. What are different methods of refresh?
Explain select statements in sql?
What is difference between sql and excel?
what is self-join? : Sql dba
What is sql used for?
What are the advantages of pl sql?
Why is pl sql used?