Follow us: Connect on YouTube Connect on YouTube Connect on YouTube

Pages

Tuesday, 27 June 2017

Alter Table add Primary key Oracle


This is used to avoid duplicates and nulls. This will work as combination of unique and not null. Primary key always attached to the parent table.

 Alter Table add Primary key Example


SQL> ALTER TABLE student ADD PRIMARY KEY(no);
          SQL> ALTER TABLE student ADD CONSTRAINT pk PRIMARY KEY(no);
Share this article :

0 comments:

Post a Comment