[go: up one dir, main page]

0% found this document useful (0 votes)
7 views1 page

DDL Assignments

The document outlines a DDL assignment requiring SQL queries to create a Company database, including tables for departments and employees with specified columns and constraints. It also requests modifications to the department table, explanations of SQL commands for DROP and TRUNCATE, and a discussion on the implications of a UNIQUE KEY constraint. Additionally, contact information is provided for further inquiries.

Uploaded by

Madhu Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

DDL Assignments

The document outlines a DDL assignment requiring SQL queries to create a Company database, including tables for departments and employees with specified columns and constraints. It also requests modifications to the department table, explanations of SQL commands for DROP and TRUNCATE, and a discussion on the implications of a UNIQUE KEY constraint. Additionally, contact information is provided for further inquiries.

Uploaded by

Madhu Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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

You might also like