SQL update | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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 Respostas
+ 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