Hi,
I'm new to Oracle and SQL and am a bit stuck on a simple query.
I'm trying to pay supervisors 50,000 per year but I'm running into problems:
INSERT INTO employee
VALUES(‘10000’,’00001’, NULL, ‘Bob’, ‘Jones’, ‘18’, ‘Croft Lane’, ‘Stonehaven’, ‘Scotland’, ‘DD46YH’, ’10-OCT-54’, ‘10000.00’, ‘01234543210’);
COMMIT;
INSERT INTO employee
VALUES(‘10001’,’00001’, ‘10000’, ‘Susan’, ‘Smith’, ‘87’, ‘Long Path’, ‘Glasgow’, ‘Scotland’, ‘EH56JB’, ’29-JUN-72’, ‘42000.00’, ‘09876543211’);
The third column of the second INSERT is the supervisorID so Bob supervises Susan.
I have got this far with the query:
UPDATE employee SET salary=50000
WHERE supervisorID IS NOT NULL
AND supervisorID =
(SELECT empID FROM employee);
but this just updates Susans wage, I can see how it does but I cannot find out how to make bob (the supervisor) get the wage he deserves.
P.S Names etc. have been changed.
Thanks