Add two conditions for one column
SQL>
SQL> CREATE TABLE product (
2 product_name VARCHAR2(25),
3 product_price NUMBER(4,2),
4 quantity_on_hand number
5 );
Table created.
SQL>
SQL>
SQL> ALTER TABLE product ADD (
2 CONSTRAINT positive_quantity CHECK(
3 quantity_on_hand IS NOT NULL
4 AND
5 quantity_on_hand >=0
6 )
7 );
Table altered.
SQL>
SQL> drop table product;
Table dropped.
SQL>
Related examples in the same category