MSSQL DDL Create with 3 values in employee status (0=working, 1=paid leave, 2=out)

Viewed 33

I'm learning SQL DDL statement and I don't know what command/query to use with Employe status for this assignment. Please point me in the right direction. Thank you in advance!

Assignment: Create table Employee with Employee level ranging from 1 to 7; Employee status with 0 = working, 1 = paid leave, 2 = out

CREATE TABLE EMPLOYEE
(
EmpID VARCHAR(10) PRIMARY KEY
EmpLevel TINYINT CHECK (1<=EmpLevel<=7)
EmpStatus
1 Answers

You can use this for table creation

CREATE TABLE EMPLOYEE
(
    EmpID VARCHAR(10) PRIMARY KEY,
    EmpLevel TINYINT NOT NULL CHECK (EmpLevel Between 1 and 7),
    EmpStatus int null)
Related