2. Write an anonymous PL/SQL block to calculate the yearly bonus that a
company gives to its employees. The bonus is determined by considering two factors: (1) how many years the employee has worked at the company; (2) employee job type.
If an employee has worked 1-6 years, then he or she receives a $150 bonus; 7-10 years merits a $200 bonus; 11-15 years merits a $300 bonus, and 16 or over 16 years merits a $500 bonus.
Employees in Job ID âSA_REPâ receive an additional $300 bonus, and employees in other types receive an additional $200 bonus.
Sample input and output:
a. Output with employee_id = 120:
SET SERVEROUTPUT ON
DEFINE p_empno = 120
(Execute these commands, and then clear the screen. Next, execute the program code)
The bonus for this employee is: $500
PL/SQL procedure successfully completed.





