Setting the Check constraint for int value field during declaration : Constraint Check « Constraints « Oracle PL / SQL
- Oracle PL / SQL
- Constraints
- Constraint Check
Setting the Check constraint for int value field during declaration
SQL>
SQL> CREATE TABLE myTable (
2 Name VARCHAR(50) PRIMARY KEY NOT NULL,
3 PhoneNo VARCHAR(15) DEFAULT 'Unknown Phone',
4 Age INT CHECK (Age BETWEEN 10 and 100));
Table created.
SQL>
SQL> drop table myTable;
Table dropped.
Related examples in the same category