Professional Documents
Culture Documents
Cycle – 3
INVENTORY
Item_ID Item_name Quantity ROL ROQ
3. Write a PL/SQL program to read two numbers, calculate their HCF and
LCM and store the details in the numbers table.
NUMBERS
Number1 Number2 HCF LCM
4. Consider the following relation schemas
Inventory
Product_ID Product_name Quantity
Purchase_Record
Product_ID Status Date
Write a PL/SQL block to read the quantity of a product from inventory and if it is
> 0 reduce the quantity by 1 and record the status of purchase of that product
as ‘PURCHASED’. Otherwise record the status of purchase of that product as
‘OUT OF STOCK’. While recording the status of a purchase, record the date of
transaction.
Enrollment
Student_Id Courseid Instructor_name
Del_Audit
CourseId Rows_deleted date
Write a PL/SQL block to delete records of all courses for which no student
is enrolled and then record the Course ID, no of rows deleted and date on
which deletion occurred in the Del_Audit table.
8. Write a PL/SQL block that displays the employee names and their total earnings
from the Emp Table.
Hint: Total earning of an employee = 12*(gross_salary+commission)