write a program that gives all emolyees in mechanical department.
(1) update the salary with 15% pay increase
(2) display a message displaying how many employees were awarded the increase. if no employee found print the message 'No records round.
Answers
Answered by
0
Answer:
1) DROP TABLE emp_temp;
2) CREATE TABLE emp_temp AS
SELECT employee_id,
first_name,
last_name,
department_id,
salary
FROM employees;
4) DECLARE
CURSOR employee_cur IS
SELECT employee_id,
salary
FROM emp_temp
WHERE department_id = 50
FOR UPDATE;
incr_sal NUMBER;
5)BEGIN
FOR employee_rec IN employee_cur LOOP
IF employee_rec.salary < 15000 THEN
incr_sal := .15;
ELSE
incr_sal := .10;
END IF;
UPDATE emp_temp
SET salary = salary + salary * incr_sal
WHERE CURRENT OF employee_cur;
END LOOP;
END;
Similar questions