Gaming Data with Twitch Project - Question 7

Hi guys. Can you help me figure out why this code to answer does not also work for question 7?

SELECT game, CASE WHEN game LIKE 'League%' OR game LIKE 'Dota%' OR game LIKE 'Heroes%' THEN 'MOBA' WHEN game LIKE 'Counter%' THEN 'FPS' WHEN game LIKE 'DayZ' OR game LIKE 'ARK%' THEN 'Survival' ELSE 'Other' END AS 'genre', FROM stream GROUP BY 1 ORDER BY 3 DESC;

https://www.codecademy.com/paths/analyze-data-with-sql/tracks/sql-interview-prep/modules/sql-interview-prep/projects/analyze-data-with-sql-twitch

If you want to hunt it down try editing out the relevant sections with -- or /* */ to see what does and what does not work. I think it could be either GROUP BY 3 as there are only 2 cols in output or the extra , after the CASE (possibly both).

1 Like

Ahh, can’t believe I missed that. That fixed it, thank you!

1 Like