SQL Check Constraints
Advertisements
SQL Check Constraints
Check Constraints does not allow the values which are not satisfied the given condition. You can apply Check constraints on more than one column in same table. Check constraints allows to enter null values.
Example
create table employee (eid number(3), ename varchar2(15), sal number(5) check (sal>50000));
Employee table
In below table you can enter salary more than 50000
emp_id | name | salary |
---|---|---|
101 | Amit | 74000 |
102 | Rahul | 84000 |
103 | Sultan | 54000 |
104 | Gaurav | 60000 |
105 | Hitesh | 95000 |
Google Advertisment