what is the difference between unique and primary key
Answers were Sorted based on User's Feedback
Answer / ravi kanth
Primary key is the combination of unique and not null.But
unique key accepts null values also.
Is This Answer Correct ? | 6 Yes | 1 No |
Answer / suresh kumar somayajula
Unique Key allows NULL value and a table can have more than
one UNIQUE KEY Constraint.
Primary Key is the combination of UNIQUE+NOT NULL,means it
won't allow NULL Values and a table can have only one
Primary Key.But a table can have Composite Primary Key.
Thank you,
Suresh
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / priyanka
Both are uniqe identification keys but Primary key should
not be null but uniqe key should.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / divyarao
primary key accepts only values which has no duplication ,and does not accept null values . for a a table there should be only one primary key constraint.
whereas in unique key ,it accepts null values .here also there should not be any duplication ,a table may have more than one unique key constarint
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vinod
uniqe key allow one null value only but primary key cannot
allow any null value
Is This Answer Correct ? | 0 Yes | 1 No |
What's the difference between file and database?
What are the examples of database?
What is system catalog or catalog relation?
What is database bloat?
What is dbms_output put_line?
what is the diff between dbms and rdbms(what are the 12 rilations in the rdbms).
What is db driver?
What are the two types of data independence?
What are the disadvantages of a query?
Is there some bulk load or other way to import a lot of data fast?
Explain degree of a relation?
What is the main purpose of triggers in database?