top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to create composite primary key in oracle/SQL?

+2 votes
359 views

I have created one table where I want to add combination of multiple column as primary key.

Can someone please help me to know how to do this?

posted Mar 7, 2015 by Varun Kumar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

In Oracle you can do like this:

create table D (
  ID numeric(1),
  CODE varchar(2),
  constraint PK_D primary key (ID, CODE)
)
answer Mar 8, 2015 by Amit Kumar Pandey
...