0

SQL annual bonus salary challenge

I am having trouble getting the $500 bonus to multiply by the number years. I keep getting the correct results as far as columns and I get an output but it’s only adding 500 to salary and creating the “total” string based on that. It’s not multiplying by number of years experience. Here has what I have: SELECT CONCAT (firstname, ' ', lastname) AS fullname, salary + experience * 500 AS total FROM staff ORDER by total;

24th Jan 2021, 3:56 PM
Karsa9Fingers
Karsa9Fingers - avatar
6 Respuestas
+ 3
Karsa9Fingers Here should be (salary * 12) + 500 * experience
24th Jan 2021, 6:17 PM
A͢J
A͢J - avatar
+ 2
ok in reviewing it seems like the math is incorrect on the part of sololearns solution - anyone else encounger this?
24th Jan 2021, 6:15 PM
Karsa9Fingers
Karsa9Fingers - avatar
+ 2
I Am AJ ! just solved it with the following code: SELECT CONCAT (firstname, ' ', lastname) AS fullname, salary*12+500*experience AS total FROM staff ORDER by total; thank you kindly good sir.
24th Jan 2021, 6:25 PM
Karsa9Fingers
Karsa9Fingers - avatar
+ 1
ohhh so salary column is monthly? did i miss that in the instructions?
24th Jan 2021, 6:23 PM
Karsa9Fingers
Karsa9Fingers - avatar
+ 1
SELECT CONCAT (firstname, ' ' ,lastname) AS fullname, (salary*12)+(experience*500) AS total FROM staff ORDER BY total ;
13th Sep 2021, 3:54 AM
Joan Daniel Rivas Andrade
Joan Daniel Rivas Andrade - avatar
0
Karsa9Fingers jumping in here 2 months late because there was nothing on here that said this was a monthly salary. ive been stuck on this for like 15 minutes.
7th Mar 2021, 4:35 AM
Ellious