1. Create a PL/SQL block that selects the maximum department number in the DEPARTMENTS table and stores it in a variable. Print the results to the screen.
into V_max from department;
3. Write a PL/SQL block which accepts employee name, basic and should displayEmployee name, PF and net salary.
HRA=30% of basic salary
DA=75% of basic salary
If the basic is less than 8000 PF is 5% of basic salary.
If the basic is between 8000 and 15000 PF is 7% of basic salary.
If the basic is between 15000 and above PF is 8% of basic salary.
select name,salary into V_name,V_salary from employee where name=&V_name;
pf:=V_salary * (5/100);
when V_salary between 8000 and 15000
pf:=V_salary * (7/100);
netsalary:=V_salary+ da + hra -pf;
dbms_output.put_line(‘The pf and Netsalary for ‘||V_name||’ is ‘||pf||’ and ‘||netsalary||’ ‘);
when NO_DATA_FOUND then
dbms_output.put_line(’employee donot exists’);