SQl plus question about multiple primary keys in same table

piski

Senior member
Jan 21, 2002
312
0
0
I have an associative entity table (therefore there are 2 primary keys). In SQLplus, how do i create a table with multpile primary keys?

CREATE TABLE tablename(
primary_one number(10) PRIMARY KEY
,primary_two number(10) PRIMARY KEY
);

???????

Please help, thanks
 

imported_jediknight

Senior member
Jun 24, 2004
343
0
0
You don't. Each table can have only one primary key.
You can, however make the entire tuple the primary key, or make one UNIQUE. The syntax for either escapes me at the moment..
 

dsfunk

Golden Member
May 28, 2004
1,246
0
0
one primary key using both of those fields

you separate out the primary key definition...goes something like...

constraint PRIMARY KEY (primary_one,primary_two)