Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Table
 

Adding a Constraint

Constraint Constraint Type Meaning CHECKCSpecifies a certain condition for a column, or group of columns. NOT NULLCNot null column PRIMARY KEYPprimary key FOREIGN KEYRforeign key UNIQUEUunique CHECK OPTIONVSpecifies that DML operations on a view must satisfy the subquery. READ ONLYOSpecifies that a view may only be read from. SQL> CREATE TABLE pet (   2  id NUMBER(38) CONSTRAINT pk_pet PRIMARY KEY NOT NULL   3  ); Table created. SQL> SQL> drop table pet; Table dropped. SQL>