Thursday, 26 June 2014

constraint in sql server

CREATE TABLE EMP123
(

            EMPNO INT PRIMARY KEY,

            ENAME VARCHAR(30) DEFAULT 'NOT KNOWN',

            DOB DATETIME NOT NULL,

            HIREDATE DATETIME,

            EMAIL VARCHAR(50) UNIQUE ,

            MOBILE VARCHAR(10) UNIQUE,

            SAL    NUMERIC(13,2) CHECK (SAL>5000 AND SAL<500000),

            DEPTNO INT FOREIGN KEY REFERENCES DEPT(DEPTNO) on  delete cascade

)

No comments:

Post a Comment