Problem: Get the match number and the sets won and lost in each match where num of sets won is >= num of sets lost multiplied by 2.
Wrong query:
use tennis;
select matchno, lost * 2 AS spl
from matches
where won >= spl
What is wrong in this query? How can it be modified to get the right output?
Correct query:
select matchno, won, lost
from matches
where won >= lost * 2
SELECT matchno, lost * 2 AS spl
FROM matches
WHERE won >= (lost * 2)