DDL Assignment
Please write SQL queries/commands for the following:
1. Create a Company database.
2. Create department table with column names as follows:
Column name Data type Constraint
deptid int Primary key
dname varchar(20) not null
location varchar(20) not null
3. Create employee table with column names as follows:
Column name Data type Constraint
empid int Primary key
ename varchar(20) not null
dob (date of birth) date
salary float not null
designation varchar(20) not null
doj (date of join) date
project varchar(20)
manager varchar(20)
mgrid int
deptid int
dname varchar(20)
4. Add column dept_head to department table, specify data type as varchar(15), constraint as
Not Null.
5. Change the data type of mgr_id from int to Varchar(15)
6. Write the Syntax for DROP and TRUNCATE Command.
7. What is the difference between DROP and TRUNCATE.
8. What will happen if a column has UNIQUE KEY constraint?
Contact us @ +91-9741267715/+91-9535539214 Page 1