Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. DECLARE
  2. v_employee_id NUMBER;
  3. v_last_name VARCHAR(255);
  4. v_salary NUMBER;
  5. v_bonus NUMBER;
  6. v_counter NUMBER := 100;
  7. BEGIN
  8. WHILE v_counter <= 150 LOOP
  9. SELECT employee_id, last_name, salary INTO v_employee_id, v_last_name, v_salary FROM hr.employees WHERE employee_id = v_counter;
  10. IF v_salary > 15000 THEN v_bonus := v_salary*0.1;
  11. ELSIF v_salary < 15000 THEN v_bonus := v_salary*0.05;
  12. END IF;
  13. DBMS_OUTPUT.PUT_LINE('ID: ' || v_employee_id || ' | Last Name: '|| v_last_name || ' | Salary: ' || v_salary || ' | Bonus: ' || v_bonus || ' |');
  14. v_counter := v_counter+1;
  15. END LOOP;
  16. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement