Share

Search Database SQL / Scripts


  Help us in improving the repository. Add new Queries/Scripts through 'Submit Database SQL / Scripts ' link.





Database SQL / Scripts for '#ADD CONSTRAINT' - 3 Query/Script(s) found

 Sample 1. Add Primary Key constraint to a Table

ALTER TABLE TABLE_NAME
ADD CONSTRAINT CONSTRAINT_NAME primary key (COLUMN_NAME);

   Like      Feedback     Add Primary Key Constraint  Constraint  Alter Table  Alter  ADD CONSTRAINT   DDL


 Sample 2. Adding Composite Key as Primary Key

ALTER TABLE TABLE_NAME
ADD CONSTRAINT CONSTRAINT_NAME primary key (COLUMN_1_NAME,COLUMN_2_NAME );

   Like      Feedback     composite primary key   primary key  alter  alter table  constraint  add constraint


 Sample 3. Set Primary Key on an already created table

ALTER TABLE EMPLOYEE
ADD CONSTRAINT EMPLOYEE#ID_PRIMARY_KEY
PRIMARY KEY (ID);

   Like      Feedback     set primary key after table creation   add primary key constraint



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus