RDBMS SOLUTION


ASSIGNMENT 4 

SET A Q. 2 SOLUTION

Write a function which will return total number of policies opened no “1Jan-2020”




Source code:

    

    /*set a q 2 solution

    here we have to run one simple select statement

    we will use min() aggregate function to find minimum maturity amount*/

/*creating function*/

create or replace function min_mat

return number is min_amt number;

begin

select min(maturity_amt) into min_amt from policy_info;

return min_amt;

end;

/*Execution*/

declare

minn number;

begin

minn:=min_mat();

dbms_output.put_line('minimum maturity ammount is:   '||minn);

end;

   

    
 Download code         next