Salary column value cannot be greater than 1000 : Add Constraint « Constraints « Oracle PL / SQL






Salary column value cannot be greater than 1000

    
SQL>
SQL>
SQL> create table emp(
  2    EmpNo            NUMBER(10)    PRIMARY KEY,
  3    Name             VARCHAR2(40)  NOT NULL,
  4    DeptNo           NUMBER(2)     DEFAULT NULL,
  5    Salary           NUMBER(7,2)   CHECK (salary < 1000),
  6    Birth_Date       DATE,
  7    Soc_Sec_Num      CHAR(9)       UNIQUE);

Table created.

SQL>
SQL>
SQL>
SQL>
SQL> drop table emp;

Table dropped.

SQL>
SQL>

   
    
    
    
  








Related examples in the same category

1.Adding constraints to a table: not null
2.Alter table to add constraint with name
3.Naming contraints