How to set two primary keys in one table in oracle? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to set two primary keys in one table in oracle?

set one primary key at table creation and another one is after creation of primary key.

18th Sep 2017, 10:02 AM
Bhumika
Bhumika - avatar
3 Answers
0
You can add a unique constraint...even several...
19th Sep 2017, 11:07 PM
Nicola
+ 1
create table tablename (column1, column2 , primary key(column1,column2))
18th Sep 2017, 10:23 AM
kanishk goel
kanishk goel - avatar
+ 1
One table can only have only one Primary Key, but can have more than 1 foreign key. 2 primary key is not necessary practically too.
18th Sep 2017, 10:24 AM
Niush
Niush - avatar