SELECT
CASE WHEN revenue > budget THEN
'good'
WHEN revenue < budget THEN
'bad'
WHEN revenue = budget THEN
'same'
END AS compare_money,
COUNT(*) AS total_movies
FROM
movies
WHERE 1=1
AND revenue IS NOT NULL
AND budget IS NOT NULL
GROUP BY
compare_money
ORDER BY
total_movies DESC;