Queries 14/15

SELECT genre,
CASE
WHEN genre = ‘romance’ THEN 'fun’
WHEN genre = ‘comedy’ THEN 'fun’
ELSE 'serious’
END as 'mood’
FROM movies;

Code gets generated but i got error message: ‘Type the code in the code editor using the appropriate clauses.’

Please help !

Hi,
The issue is very subtle and you need to pay close look at the single quotes for serious and mood.

you basically using 2 different type of single quotes this ` and this ’

review that and it should work just fine

When i copy, paste it into the chat it changes. I’ve corrected it and used different clauses but i still got the same message, is there anything else i can do ?

SELECT name,
CASE
WHEN genre = ‘romance’ THEN 'fun’
WHEN genre = ‘comedy’ THEN 'fun’
ELSE 'serious’
END AS 'mood’
FROM movies;

Hi, this is the correct query (after a long figth).
I hope you have solved it.

1 Like

Works, thank you man ! :grinning:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.