Cse2007 - Database Management Systems
Cse2007 - Database Management Systems
Cse2007 - Database Management Systems
Lab Exercises
1. Create Table Employee with attributes firstName,LastName,SSN,Address,Salary,Birthday,
Sex,SupervisorSSN,DepartmentNo.
2. Create a Table Department with attributes DNo,DNAMe,ManagerSSN,MgrStartdate.
3. Insert the data given above in both employee, department and project tables.
4. Display all the employees’ information.
5. Display Employee name along with his SSN and Supervisor SSN.
6. Display the employee names whose bdate is ’29-MAR-1959’.
7. Display salary of the employees without duplications.
8. Display the MgrSSN, MgrStartDate of the manager of ‘Finance’ department.
9. Modify the department number of an employee having fname as ‘Joyce’ to 5
10. Alter Table department add column DepartmentPhoneNum of NUMBER data type
and insert values into this column only.
11. Alter table department to modify the size of DepartmentPhoneNum.
12. Modify the field name DepartmentPhoneNum of departments table to PhNo.
13. Rename Table Department as DEPT.
14. Alter Table department remove column PhNo.
15. Create a table COPYOFDEPT as a copy of the table DEPT.
16. Delete all the rows from COPYOF DEPT table.
17. Remove COPYOF DEPT table.
18. Add Foreign Keys using Alter Table .
19. Drop Foreign key defined on SuperSSN and add it using Alter table command.
20. Find the employee names having salary greater than Rs.25000.
21. Find the employee names whose salary lies in the range between 30000 and 70000.
22. Find the employees who have no supervisor.
23. Display the bdate of all employee s in the format ‘DDthMonthYYYY’.
24. Display the employee names whose bdate is on or before 1978.
25. Display the employee names having ‘salt lake’ in their address.
26. Display the department name that starts with ’M’.
27. Display the department names’ that ends with ‘E’.
28. Display the names of all the employees having supervisor with any of the following
SSN 554433221, 333445555.
29. Display all the department names in upper case and lower case.
30. Display the first four characters and last four of the department names using substring
function.
31. Display the substring of the Address (starting from 5th position to 11 th position) of all
employees.
32. Display the Mgrstartdate on adding three months to it.
33. Display the age of all the employees rounded to two digits.
34. Find the last day and next day of the month in which each manager has joined.
35. Print a substring from the string ‘Harini’.
36. Replace the string ‘ni’ from ‘Harini’ by ‘sh’.
37. Print the length of all the department names.
38. Print the system date in the format 25 th May 2007.
39. Display the date after 10 months from current date.
40. Display the next occurrence of Friday in this month.
41. How many different departments are there in the ‘employee’ table
42. For each department display the minimum and maximum employee salaries
43. Print the average annual salary.
44. Count the number of employees over 30 age.
45. Print the Department name and average salary of each department.
46. Create a view to display the employee details who is working in IT department.
47. Create a logical table to store employee details who is getting salary more than 10000.
48. Create a table to store the employees details based on the department no
49. List the names of all managers who have no dependents.
50. List the employee’s names and the department names if they happen to manage a department.
51. Hello World Program in PL/SQL
52. PL/SQL Program To Add Two Numbers
53. PL/SQL Program for Prime Number
54. PL/SQL Program to Find Factorial of a Number
55. PL/SQL Program to Print Table of a Number
56. PL/SQL Program for Reverse of a Number
57. PL/SQL Program for Fibonacci Series
58. PL/SQL Procedure to Check Number is Odd or Even
59. PL/SQL Function to Reverse a String
60. Write a PL/SQL program to retrieve the employees working in DNO=5 and increase their
salary by 10%.
61. Write a PL/SQL cursor
62. Study of PL/SQL Conditional Statements
63. Study of PL/SQL Loops
a. Study of PL/SQL procedures and functions
b. Study of PL/SQL cursors
c. Write a program using PL/SQL to raise Triggers
d. Write a PL/SQL program to handle Exceptions
Text Books
1. R. Elmasri & S. B. Navathe, “Fundamentals of Database Systems”, Pearson Education 7 th
Edition, 2017.
References
1. A. Silberschatz, H. F. Korth & S. Sudershan, “ Database System Concepts”, McGraw
Hill, 7th Edition 2016.
2. Hector Garcia-Molina, Jeffrey D.Ullman, Jennifer Widom, “Databse Systems:The
Complete Book”, Pearson Education, Second Edition, 2014.
3. Raghu Ramakrishnan and Johannes Gehrke, “ Database Management Systems” , Mc
Graw Hill,2014
Mode of Evaluation Cumulative Lab Assessment 20%
Continuous Assessment Test-1 20%
Continuous Assessment Test-2 20%
Continuous Assessment Test-3 20%
Practical Assessment (Mini Project) 20%
Modified by Dr. Abhijit Adhikari and Dr. Sandipan Maiti
Recommended by the Board of
9th BoS Meeting, 23.04.2022
Studies on
Date of Approval by the Academic
8th Academic Council, 26.04.2022
Council