Advertisement
Kartik_866

Bonus

Apr 14th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.55 KB | None | 0 0
  1. -- accept x number prompt 'Please enter the salary: ';
  2. DECLARE
  3.     salary NUMBER;
  4.     gender CHAR;
  5.     bonus_percent NUMBER;
  6.     FUNCTION sal(a IN NUMBER)
  7.         RETURN NUMBER
  8.         IS
  9.         BEGIN
  10.             IF(a < 10000)
  11.             THEN
  12.                 RETURN 0;
  13.             ELSE
  14.                 RETURN 2;
  15.             END IF;
  16.         END;
  17.  
  18. BEGIN
  19.     salary :=: salary;
  20.     gender :=: gender;
  21.     IF(gender == 'M' || gender == 'm')
  22.     THEN
  23.         bonus_percent := bonus_percent + 5;
  24.     ELSE
  25.         bonus_percent := bonus_percent + 10;
  26.     END IF;
  27. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement