You are on page 1of 1

EXERCISE 11: To implement Cursor and Trigger.

Faculty Name: Dr. Abishi Chowdhury

Lab Slot: L09+L10

Class Number: CH2022232500817


Subject: Database System Lab (BCSE302P)

Date: 04/07/2023
Due Date for Submission: 07/07/2023

1. Create the following relation:


Student (sID: int, sName: varchar2(10), CGPA: int, city: varchar2(15),
phone_number: int)
Insert 10 tuples in Student.
2. Write a PL/SQL code block that displays the names, CGPA, and city of
students using an explicit cursor.
3. Demonstrate an example for implicit cursor – ROWCOUNT.
4. Write a PL/SQL code block that displays the names of students whose
CGPA is greater than 8 using an explicit cursor.
5. Create a trigger named display_CGPA_changes. The trigger should fire
whenever there is a delete or insert or update on student table. The
difference in CGPA should be computed and displayed.

NOTE: While creating any new table suffix your first name
along with last two digits of your registration number.
Eg: STUDENT_Abishi94

You might also like