Queries 14/15


#1

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 !


#2

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


#3

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 ?


#4

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.


#5

Works, thank you man ! :grinning:


#6

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