I’m doing the “Biggest age group in USA” exercise, however, I was trying to experiment and to a little change in the analysis by trying to visualize the groups by country, but I keep getting an error with the following query:
SELECT
CASE
WHEN age < 13 THEN 'kid'
WHEN age < 18 THEN 'teenager'
WHEN age < 25 THEN 'college'
WHEN age < 35 THEN 'young adult'
WHEN age < 56 THEN 'middle age'
ELSE 'older adult'
END AS age_group,
country,
COUNT(*)
FROM users
GROUP BY 1
GROUP BY country
Thank you all!!