Dbms-Lab Manual
Dbms-Lab Manual
22MCA HCP2.4 :
DATABASE MANAGEMENT SYSTEM LAB
A1:
A2:
1. Create a table
EMPLOYEE (Emp_no, E_name, E_address, E_ph_no, Dept_no, Dept_name,Job_id , Salary)
2. Write SQL queries for following question: 1
1. Insert aleast 10 rows in the table.
2. Display all the information of EMP table.
3. Display the record of each employee who works in department D10.
4. Update the city of Emp_no-12 with current city as Nagpur.
5. Display the details of Employee who works in department MECH.
6. Delete the email_id of employee James.
7. Display the complete record of employees working in SALES Department.
A3:
1. List the E_no, E_name, Salary of all employees working for MANAGER.
2. Display all the details of the employee whose salary is more than the Sal of any ANALYST.
3. List the employees in the ascending order of Designations of those joined after 1981.
4. List the employees along with their Experience and Daily Salary.
5. List the employees who are either ‘CLERK’ or ‘ANALYST’ .
6. List the employees who joined on 1-MAY-81, 3-DEC-81, 17-DEC-81,19-JAN-80 .
7. List the employees who are working for the Deptno 10 or20.
8. List the Enames those are starting with ‘S’ .
9. Dislay the name as well as the first five characters of name(s) starting with ‘H’
10. List all the emps except ‘PRESIDENT’ & ‘MGR” in asc order of Salaries.
11. Display all the dept numbers available with the dept and emp tables avoiding duplicates.
12. Display all the dept numbers available with the dept and emp tables.
2 | 22MCA HCP2.4DBMS
13. Display all the dept numbers available in emp and not in dept tables and vice versa
A6: Study & Implementation of Group by & Having Clause Order by Clause Indexing
3 | 22MCA HCP2.4DBMS
A7: Implementation of Sub queries Views
A9: Creating Database/ Table Space Managing Users: - Create User, Delete User Managing Passwords
1. Create user and implement the following commands on relation (Emp and Dept).
2. Develop a query to grant all privileges of employees table into departments table.
3. Develop a query to grant some privileges of employees table into departments table.
4. Develop a query to revoke all privileges of employees table from departments table.
5. Develop a query to revoke some privileges of employees table from departments table.
1. Write a PL/SQL block to find the maximum number from given threenumbers.
4 | 22MCA HCP2.4DBMS
2. Write a PL/SQL program to find the total and average of 4 subjects and display the grade
3. Write a PL / SQL program to check whether the given number is prime or not.
4. Write a PL/SQL program to accept a string and remove the vowels from the string. (When ‘hello’
passed to the program it should display ‘Hll’ removing e and o from the world Hello).
1) calculate the net salary and year salary if da is 30% of basic, hra is 10% of basic and pf is 7% if
basic salary is less than 8000, pf is 10% if basic sal between 8000 to160000.
2) write a pl/sql function accept date of birth as "dd-mm-yyyy" and sum all digits tillyou get single
digit number to show as he luckynumber.
A12: TRIGGERS
1. Create a row level trigger for the customers table that would fire for INSERT or UPDATE or
DELETE operations performed on the CUSTOMERS table. This trigger will display the salary
difference between the old values and new values:
2. Convert employee name into uppercase whenever an employee record is inserted or updated.
Trigger to fire before the insert orupdate.
CASE STUDY
ROADWAY TRAVELS “Roadway Travels” is in business since 1977 with several buses connecting different
places in India. Its main office is located in BIJAPUR.
5 | 22MCA HCP2.4DBMS
6 | 22MCA HCP2.4DBMS