Click here to Skip to main content
15,876,991 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Increment the Salaries by 2% and add a Comm of 250 to the existing Comm and changing the Manager to Jobs of all ‘Salesman’ whose Salaries is more than or equal to 1000

What I have tried:

SQL> update emp set sal=sal*1.5
2 where sal>1500
SQL> update emp set comm=nvl((comm,0)+300)
2 where comm>0
SQL> update emp set job='CLERK'
2 where job='SALESMAN';
Updated 20-Jul-17 22:36pm
CodeWraith 21-Jul-17 4:17am    
YOur text and the SQLstatements don't fit together at all. There is not a single match. What is your question?

1 solution

Multiplying by 1.5 does not increase by 2% - multiplying by 1.02 does that.
And salaries greater than or equal to 1000 is not worked out by comparing them with 1500.

Stop randomly guessing what you need and start thinking.
Start by writing SELECT commands to return the relevant records for each condition and check that what you get is only the right records. When you have that, write your UPDATES.
But read your question carefully - at the moment you don't appear to be trying to answer the question your tutor set.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900