0% found this document useful (0 votes)
4 views

CA4_CAP280_SetB

This document outlines an academic task template for a laboratory course on Database Management Systems, specifically focusing on PL/SQL procedures and triggers. It includes three questions requiring students to write a procedure to find the greatest of three numbers, implement a cursor for retrieving borrowed book information, and create a trigger to update order totals in an online marketplace database. Each question specifies the course outcome, Bloom's level, and marks allocated for completion.

Uploaded by

sahajlaptop0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

CA4_CAP280_SetB

This document outlines an academic task template for a laboratory course on Database Management Systems, specifically focusing on PL/SQL procedures and triggers. It includes three questions requiring students to write a procedure to find the greatest of three numbers, implement a cursor for retrieving borrowed book information, and create a trigger to update order totals in an online marketplace database. Each question specifies the course outcome, Bloom's level, and marks allocated for completion.

Uploaded by

sahajlaptop0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

ANNEXURE-1

Standard Template for Academic Tasks (22231)

Course code: CAP280


Date of allotment: ___________________ Course title: :DATABASE MANAGEMENT SYSTEMS-LABORATORY
Date of submission: __________________ Maximum Marks: 25

Question Question Statement Course Bloom’s level Marks per


Number Outcome Question
Q1 Write a Pl/Sql procedure to find greatest among three numbers CO4 L4: Analyze 10

Consider a scenario where you are developing a database 10


application for a library management system. You are tasked
Q2 with implementing a PL/SQL cursor to retrieve information CO4
about books borrowed by a specific library member. The L4: Analyze
relevant tables in the database are Members, Books, and
BorrowedBooks. The Members table contains information about
library members, the Books table contains details about available
books, and the BorrowedBooks table tracks books borrowed by
members, including the member ID, book ID, and borrowing
date.

Draft a PL/SQL cursor named book_cursor that retrieves the


following information for a given member ID (p_member_id):

Member ID
Book ID
Borrowing Date
Ensure that the cursor handles cases where the specified member

Page 1 of 3
ANNEXURE-1
Standard Template for Academic Tasks (22231)

ID does not have any borrowed books. Provide the


implementation of the book_cursor cursor along with an
example of how to use it to retrieve information for a specific
member ID
Imagine you are designing a database for an online marketplace
Q3 where customers can place orders for various products. As part
of the database design, you are tasked with implementing a CO4 L4:Analyze 05
trigger named order_total_trigger to update the total order
amount whenever a new order is inserted into the Orders table.
The Orders table contains the following columns: order_id,
customer_id, order_date, and total_amount. Additionally, there
is an OrderDetails table that stores the details of each order,
including the order_id, product_id, quantity, and unit_price.

Draft the PL/SQL trigger order_total_trigger that automatically


updates the total_amount column in the Orders table whenever a
new order is inserted. The trigger should calculate the total
amount by summing the product of the quantity and unit_price
for each item in the OrderDetails table associated with the
inserted order. Ensure that the trigger accounts for any
subsequent updates or deletions of order details and adjusts the
total amount accordingly.

Provide the implementation of the order_total_trigger trigger


along with an example of how it can be utilized to update the
total order amount in response to new order insertions.

Page 2 of 3
ANNEXURE-1
Standard Template for Academic Tasks (22231)

Page 3 of 3

You might also like