How to Use primary key in column level and table level

Posted by Ij under Oracle category on | Points: 40 | Views : 930
Primary key combination of unique and not null.that means column can't allow null vales as well as duplicates.
A table can have only one primary key.

if you want create primary key for multiple columns we need to use table level constraint.

column level
create table student(sno number primary key,sname varchar2(10),sclass number not null);

Table level
create table student(sno number,
sname varchar2(10)
sclass number not null
primary key(sname,sclass)

Comments or Responses

Login to post response