Sei sulla pagina 1di 1

CS 262: DBMS Lab

Cycle – 4

Implement a PL/SQL stored procedure for calculating ncr using fact(m), a recursive
function that returns factorial of m.

Writ a PL/SQL procedure to find the number of students who got O, A+, A, B+ and B
grades based on the marks obtained by them in a required course from the
student_marks table given below.

Student_Marks
SNO Name Course Marks
12 Akash CS112 67
53 Venkat CS113 78
32 Ram CS112 87
65 Manogna CS113 69

Write a PL/SQL block that updates salary of an employee in employee table by using
incr function which takes employee number as argument, calculates increment and
returns increment based on the following criteria.
 If salary <= 3000 – increment = 30% of salary
 If salary > 3000 and <= 6000– increment = 20% of salary
 Else increment = 10% of salary.

Write a PL/SQL function that accepts department number and returns the total salary
of the department.
Write a PL/SQL code to create, a) Package specification b) Package body. For the
insert, update, delete and select operations on the following customer table.

Cust_ID Name BirthDate Sex AnnualIncom Rating


e
C111 Alex 20-Aug-98 Male Above 100K 3
C112 Wayne 15-Nov-85 Male 70k-80k 2
C234 Tom 03-Jan-79 Male 80k-90k 1

Potrebbero piacerti anche