0

Intermediate sql taxes

Here is my code: SELECT firstname, lastname, salary, CASE WHEN salary >= 0 AND salary <= 1500 THEN salary*0.1 WHEN salary <= 1501 AND salary >= 2000 THEN salary* 0.2 ELSE salary*0.3 END AS tax FROM Employees ORDER BY lastname ASC; It failed. Can someone help me with this?

20th Mar 2023, 11:39 PM
Kim Hammar-Milliner
Kim Hammar-Milliner - avatar
4 Respostas
+ 2
You had used the wrong operators in fifth line. Write it as: >= and next is <=
21st Mar 2023, 1:09 AM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
0
I already solved it .thanks.
21st Mar 2023, 1:19 AM
Kim Hammar-Milliner
Kim Hammar-Milliner - avatar
0
SELECT firstname, lastname, salary, CASE WHEN salary >= 0 and salary<=1500 then salary * 0.1 WHEN salary >= 1501 and salary<=2000 then salary * 0.2 WHEN salary >= 2001 then salary * 0.3 END as tax FROM Employees ORDER BY lastname ASC ;
4th Dec 2024, 12:06 AM
Elias antonio Felix moncada
0
Working with taxes can be tricky, especially when you’re trying to make sense of numbers in SQL or just figuring out deductions. Seeing real examples of calculations in forums like Sololearn really highlights how attention to detail matters. I’ve also checked Liberty Tax reviews https://liberty-tax.pissedconsumer.com/review.htmland reading about other people’s experiences shows which locations handle things efficiently and which ones can be a bit slow or confusing. Combining that insight with some practical learning makes filing taxes a lot less stressful, and you get a better idea of what to expect from a tax service
16th Sep 2025, 9:30 PM
Gary Stokley
Gary Stokley - avatar