45 SQL Server Queries for practice(21-45)- Part 2
Create the Following Tables
1.
EmpReg
Column Name
|
Data type
|
Is Null
|
Constraints
|
EmpId
|
Int
|
No
|
Primary key
|
EmpName
|
Varchar(100)
|
No
|
it can not be blank
|
Gender
|
Varchar(10)
|
No
|
It can not be blank
|
DeptId
|
Int
|
No
|
Depends on the table
dept with column Id
|
Phone
|
Varchar(100)
|
Yes
|
|
Mobile
|
Varchar(100)
|
No
|
Should be unique
|
Email
|
Varchar(100)
|
no
|
Should be unique
|
Country
|
Int
|
No
|
Depends on table
country with column cid
|
state
|
Int
|
no
|
Depends on table
country with column sid
|
Salary
|
Varchar(100)
|
No
|
Should be between
5000 to 15000
|
DateOfJoining
|
datetime
|
no
|
|