0

SQL update

Please help me to write a query which increase employee’s salary by 20 percent if only the rating is above 5. I need to use UPDATE operator. Is there any bugs in query below? Update company Set salary = salary* 1.2 Where rating >=5; Or Update company Set salary = salary+(salary*0.2) Where rating>=5; Table name is company

10th Jul 2021, 4:21 PM
YokoS
2 Réponses
+ 3
YokoS 2nd query is right but rating should be greater than 5 only not equal to 5 UPDATE company SET salary = salary + salary * 0.2 WHERE rating > 5; SELECT * FROM company
10th Jul 2021, 4:49 PM
A͢J
A͢J - avatar
+ 1
Thank you for advising me. I got it :)
10th Jul 2021, 5:17 PM
YokoS