15,876,991 members
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
3
SQL> update emp set comm=nvl((comm,0)+300)
2 where comm>0
3
SQL> update emp set job='CLERK'
2 where job='SALESMAN';
Posted
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?

## Solution 1

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.

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

Top Experts
Last 24hrsThis month
 Richard Deeming 140 Pete O'Hanlon 80 Dave Kreskowiak 46 CPallini 25 Wonde Tadesse 15
 Pete O'Hanlon 1,315 OriginalGriff 970 Graeme_Grant 635 Richard Deeming 493 Dave Kreskowiak 489

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