You are on page 1of 10

A

Practical Activity Report


Submitted for
Database Management System (UCS310)

Name: Roll No.:


Nikhil Sharma 101715096
BE Third Year
Submitted
to:

Dr Anshul Parashar
Electronics and
Communication Department
TIET, Patiala

Jan – May 2020

Assignment 8
Q1. Create a stored sub program to insert a record in emp table. We have to just pass the values of
columns to this stored sub program and it should insert a record with passed parameter values.
Q2 Create a stored sub program to delete employees on the basis of passed department number.
It should return the value to provide the information of number records deleted to the calling
environment.
Q3 Write stored function to return he number of records updated by Update statement and call
this function from a block. Also Write a local function for the same.

STORED FUNCTION
LOCAL FUNCTION
Q4 Write a function which accepts an item code and find the rate of the item for the item code
supplied by fetching its value from item table. It should also find quantity from sale table for the
given item code. This function should return the value of the product of rate*quantity.
Write a PL/SQL block calls this function by passing codes from 1 to 5 and adds up the total values
returned by the function and displays it.

Item (item_code, name, rate)

Sale(Item_code, Cno, qty)

Q5. Write a Stored function to return the total marks for a particular student. Call this function
from cursor to process all the records of student. Initially Total column is NULL. Its value will be
updated by a PL/SQL block that call a stored Table STU (Rno, Name, MST, Quiz, EST, Total)
Q6 Write a stored sub program to update units and bill amount of a customer whose customer no
is passed as a parameter to this stored sub program
Q7 Write a stored sub program to update units and bill amount of all the customers in cust table

You might also like