Search

CHECK



This is used to insert the values based on specified condition.
We can add this constraint in all three levels.

Ex:
     COLUMN LEVEL

     SQL> create table student12(no number(2) , name varchar(10), marks number(3) check
             (marks > 300));
      SQL> create table student12(no number(2) , name varchar(10), marks number(3)
             constraint ch  check(marks > 300));

      TABLE LEVEL

      SQL> create table student12(no number(2) , name varchar(10), marks number(3), check
             (marks > 300));
      SQL> create table student12(no number(2) , name varchar(10), marks number(3),
             constraint ch check(marks > 300));

      ALTER LEVEL

      SQL> alter table student12 add check(marks>300);
      SQL> alter table student12 add constraint ch check(marks>300);