Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Table
 

Check constraint

SQL> SQL> create table salgrades   2  ( grade      NUMBER(2)   constraint S_PK   3                           primary key   4  , lowerlimit NUMBER(6,2) constraint S_LOWER_NN   5                           not null   6                           constraint S_LOWER_CHK   7                           check (lowerlimit >= 0)   8  , upperlimit NUMBER(6,2) constraint S_UPPER_NN   9                           not null  10  , bonus      NUMBER(6,2) constraint S_BONUS_NN  11                           not null  12  , constraint S_LO_UP_CHK check  13                           (lowerlimit <= upperlimit)  14  ); Table created. SQL> SQL> drop table salgrades; Table dropped. SQL>