0

I have a Query In MySQL
Give all managers of First Bank Corporation a 10 percent salary raise unless the salary become greater than 100000ドル; in such cases, give only a 3 percent raise.

In my Database I have following Table on which i have to work on

  • Employee(emp_name, street, city)
  • Works(emp_name, company_name, salary)
  • Company(company_name, city)
  • Manages(emp_name, manager_name)`

I have done half part of the query, now I have no idea how to do its other part

Update Works
 set Salary= salary + salary * 0.10
 where company_name = 'First Bank Corporation' AND
 emp_name IN (Select manager_name from Manages) AND
 salary > 100000;
Gordon Linoff
1.3m62 gold badges707 silver badges858 bronze badges
asked Nov 29, 2016 at 3:50

1 Answer 1

1
UPDATE ...
 SET salary = CASE
 WHEN salary * 1.10 > 100000
 THEN salary * 1.03
 ELSE salary * 1.10
 END
 WHERE ... 

-or-

UPDATE ...
 SET salary = salary * CASE
 WHEN salary * 1.10 > 100000
 THEN 1.03
 ELSE 1.10
 END
 WHERE ... 
answered Nov 29, 2016 at 3:54
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.