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
How can we optimize a sql query?
where are cookies actually stored on the hard disk? : Sql dba
How do I count rows in sql?
Which is better stored procedure or query?
What is Histogram?
Do we need to rebuild index after truncate?
What is the use of stored procedures?
How to run sql commands in sql*plus?
How do I run sql profiler?
What is a common use of group by in sql?
Can we perform dml on view?
What is the use of sql trace?
How do I save a stored procedure?
What is primary and foreign key?
What is the maximum number of rows in sql table?