0% found this document useful (0 votes)
10 views15 pages

DBMS Lab

The document outlines a practical file for a Database Management System course at Indira Gandhi Delhi Technical University for Women, authored by a student named Sana Arora. It includes a series of tasks related to creating and manipulating database tables, inserting records, applying constraints, and querying data. The tasks cover various SQL operations such as creating tables, modifying columns, deleting records, and retrieving specific employee information.
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)
10 views15 pages

DBMS Lab

The document outlines a practical file for a Database Management System course at Indira Gandhi Delhi Technical University for Women, authored by a student named Sana Arora. It includes a series of tasks related to creating and manipulating database tables, inserting records, applying constraints, and querying data. The tasks cover various SQL operations such as creating tables, modifying columns, deleting records, and retrieving specific employee information.
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/ 15

1

INDIRA GANDHI DELHI


TECHNICAL UNIVERSITY FOR
WOMEN

DBMS PRACTICAL FILE

Name: Sana Arora

Enrollment No.: 16301012022

CSE3 C5
1. Create the following Tables:

i. DEPT (did, dname, hod, address)

ii. EMPLOYEE (empno, ename, salary, designation, date of birth, deptid, pid)

iii. PROJECT (pid, pname, pdesc, deptid)

2. Add a new column fathername to the EMPLOYEE table.


3. Add a new constraint to the EMPLOYEE table which will enforce the user to insert only Manager,

Clerk or Director under designation column.

4. Increase the width of hod column from 20 to 25.

5. Insert atleast 4 records in DEPT table and 15 records in EMPLOYEE table


6. Add Address column to EMPLOYEE table and make it NOT NULL.

7. Try to delete any one record from DEPT table. Observe the error, if any.
8. Delete some of the records from DEPT table with CASCADE option

9. Copy all the data from EMPLOYEE table to a new table EMPLOYEE_HISTORY.

10. Remove the check constraint from EMPLOYEE table applied at Problem No. 3.

11. List name and salary of all employees


12. List the above in sorted order. Order by ename

13. List the name and designation of all employees of department 1001
14. Display all employees whose name starts with letter ‘S’.

15. Display all those employees whose names have exactly 4 characters

16. List all those employees who were born in the year 1982
17. Display the data which looks like:
Akshay holds the position of CEO in dept 10 and he is getting Rs.8000

18. Create a table EMP1 from EMP. Give different field names to the table and keep only the data from
dept 1001 from that table.
19. List employee names and salary increased by 20% and express as whole number of dollars.

20. List the name of those employees having even empno.


21. Change the designation for all the employees in dept 1002 from Manager to Managing Exec.

22. Display the name and date of birth of all employees in the format ‘13th January, 1995’
23. Display the date of completing the probation period (one year of service) for all employees.
24. Display the total experience of the employees in the format: 3 Years 4 Months and 24 Days
25. Find the minimum, maximum and average salary of the employees.

26. Find minimum, maximum, average salary of each designation.


27. Find all those departments where more than 2 managers are working

28. Check whether all employee numbers are unique.

29. Insert few names with their surnames and write to query to display the names in reverse order i.e.,
surname then name.
30. Display employee name, salaries with their department names.

31. Display those employees who are working in CSE dept.

32. Display the dept which has no employee.


33. Find the employee who earns the max salary in each designation type.

34. Find the employee who is hired recently.

( select ename,date_of_birth from employee where date_of_birth=(select max(date_of_birth)


from employee));

35. Find the designation having max occurrences in employee table


36. Find all those employees who are getting salary higher than the average salary of their respective
departments.
37. Who are the top three earners of the company?

You might also like