what is difference between "Primary key" and "Unique key"?

Answer Posted / swapna

1)unique key can be null but primariy key cant be null.
2)primariy key can be refrenced to other table as FK.
Primary key and unique are Entity integrity constraints
Primary key allows each row in a table to be uniquely
identified and ensures that no duplicate rows
exist and no null values are entered.
Unique key constraint is used to prevent the duplication of
key values within the rows of a table and allow null
values. (In oracle, one null is not equal to another null).

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between joins and union?

746


What are the three forms of normalization?

757


What is sql keyword?

755


Do foreign keys improve performance?

746


What is on delete restrict?

721






Why do we need cursor in pl sql?

832


What is a stored procedure in sql with example?

784


What is a primary key called that is made up of more than one field?

1026


How to move files from one directory to another in pl sql?

854


how to use case expression? : Sql dba

733


How do I find duplicates in sql?

689


how would concatenate strings in mysql? : Sql dba

740


what are the properties and different types of sub-queries? : Sql dba

704


How to change sql*plus system settings?

721


What is pls integer?

779