Difference between primary key and unique key ?

Answer Posted / bhushan tatar

column having primary key constraint should not contain
null values.

column having unique key constraint can contain null values.


Unique as well as primary key constraint can be
defined/applyed on more than one column.
EX.
ADD constraint uc_person UNIQUE(P_Id,Lastname)
ADD constraint uc_person PRIMARY KEY(P_Id,Lastname)

But whle creating table we can write unique key word
multiple time and primary key wprd only once.Because table
can have only one primary key and can have miltiple unique
key.But both can apply on more than one column.
and

Is This Answer Correct ?    10 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we use bulk collect in oracle?

712


Difference between the “verify” and “feedback” command?

1030


What is the usage of analyze command in oracle?

819


Explain implicit cursor.

755


How to put more than 1000 values into an oracle in clause?

763


How to loop through a cursor variable?

775


What is the difference between hot backup and cold backup in oracle?

723


How to convert raw data type into text in oracle? Explain

775


Give the different types of rollback segments.

775


What is a data dictionary and how can it be created?

803


What is open database communication (odbc) in oracle?

705


Can we convert a date to char in oracle and if so, what would be the syntax?

747


List out the components of logical database structure of oracle database.

780


How to compare dates in oracle sql?

831


How to view all columns in an existing table?

700