Ex 6
Ex 6
1. Create a procedure to find the number of students ranging from 100- 70%, 69-60%,
59-50% &
below 49% in each course from the student_marks table given by the procedure as
parameter.
3. Create a function that accepts 2 numbers and returns the addition of passed
values. Also write
the code to call your function.
DECLARE
v_a NUMBER := &v_a;
v_b NUMBER := &v_b;
v_sum_result NUMBER;
BEGIN
v_sum_result := add_numbers(v_a, v_b);
DBMS_OUTPUT.PUT_LINE('Sum Result: ' || v_sum_result);
END;
/
4.Write a PL/SQL function that accepts department number and returns the total
salary of the
department. Also write a function to call the function.
begin
select sum(salary) into v_tot_salary from employee where dno = dnumber;
return v_tot_salary;
end tot_salary;
/
DECLARE
dnumber NUMBER := &dnumber;
v_tot_salary NUMBER;
BEGIN
v_tot_salary := tot_salary(dnumber);