Professional Documents
Culture Documents
BCA
Course : US03CBCA22
(Database Management System - II Lab)
Credits : 02
Lab Hr Per Week : 04
Page 1 of 6
(US03CBCA22)
Journal List
Page 2 of 6
3. Create table CUSTOMER_MST
Page 3 of 6
Assignment 02 : PL/SQL Block:
Assignment 03 : PL/SQL Block – Implicit cursor (EMP and DEPT table) (Use of
COMMIT, ROLLBACK and SAVEPOINT)
1. Write a PL/SQL block that will take an input in the form of department number.
Increase the salaries of the employees working in the department by 5.5%. If the
increment updates the total salary of that department by 255 take back the
increment else give the increment permanently.
2. Write a PL/SQL block that will update the salaries of the employees working with
SCOTT. If more than FOUR employees salaries are affected by the increment take
back the increment, else give the increment permanently.
3. Write a PL/SQL block that will take an input in the form of department number.
Decrease the salaries of the employees working in that department by 0.75%. If at
least a record is updated keep the change permanent else print appropriate
message and terminate the block.
Assignment 04 : CURSOR
1. Display empno, name, salary, job and deptno of employees using cursor &
%rowtype
2. Write a cursor to display Department wise Employee information in following
format.
Department wise Employee Information
------------------------------------------------------
Department No. : XX Department Name: XXXX
----------------------------------------------------------------------------------------------
Employee Employee Job Salary Commission Hiredate
Number Name
----------------------------------------------------------------------------------------------
. .. .. ..
. .. .. ..
----------------------------------------------------------------------------------------------
Page 4 of 6
Department No. : XX Department Name: XXXX
----------------------------------------------------------------------------------------------
Employee Employee Job Salary Commission Hiredate
Number Name
----------------------------------------------------------------------------------------------
. .. .. ..
. .. .. ..
----------------------------------------------------------------------------------------------
3. Write a cursor to display the Electricity consumption report in following format.
Electricity consumption
------------------------------------------------------------------------------------------------------------
Customer No Name Consumption City
. .. .. ..
. .. .. ..
------------------------------------------------------------------------------------------------------------
Total Consumption: -----------
4. Write a cursor that will take input as a city and month. And display the inputted
month wise report for particular city in the following format:
Electricity Bill
Current Date:_______
Month: __________
------------------------------------------------------------------------------------------------------------
Readings
Customer No. Name Previous Current Consumption Unit Price Total
Bill
------------------------------------------------------------------------------------------------------------
* ** ** ** ** ** ***
* ** ** ** ** ** ***
------------------------------------------------------------------------------------------------------------
Assignment 05 : PL/SQL Block with exception handling. (EMP and DEPT table)
1. Write a PL/SQL block to take an input in the form of department number. Print
department information if the department number is present in the DEPT table else
print appropriate message and terminate the block.
2. Write a PL/SQL block to take an input in the form of job. Print employee
information if the job is with one employee in the EMP table, if the job is with more
than one employee print appropriate message and terminate the block, and if the
job is not present print appropriate message and terminate the block.
3. Write a PL/SQL block to take an input in the form of department number. If the total
salary paid to that department is greater than 1900 then raise the user defined
exception, print appropriate message and terminate the block. If the total salary is
less than or equal to 1900 update the salaries of the employees working in the
department by 2.5%.
Page 5 of 6
Assignment 06 : FUNCTION
Assignment 07 : PROCEDURE
1. Write a procedure to display the employee name if the salary > 3500 --for a
particular empno. (supply an empno & return employee name)
2. Write a procedure that will take department number, if that department is having
more than four employees print that department information from the procedure,
else print appropriate message from the BLOCK which calls the procedure.
Assignment 08 : TRIGGERS
1. Insert a record in EMP1 table as and when user inserts a record in EMP table.
2. Insert record(s) in EMP1 table as and when user updates record(s) of EMP table.
3. Insert record(s) in EMP1 table when user deletes record(s) from EMP table.
Page 6 of 6