FAQ: Queries - Case

Because it is a list of column names. Lists are generally comma separated.

There is a comma after name, because we actually query 2 lists from the table movies.
1 list is the column of name, and the other list is the outcome of CASE-END statement.

2 lists are generally separated by comma(like the example below):
SELECT name, year
FROM movies;

this works well, I tried, thank you

I tried to use what I learned from this course before CASE to solve this problem and it seems working:


ADD COLUMN ‘Mood’ Text;

UPDATE movies

SET Mood = ‘Chill’

WHERE genre = ‘romance’ OR genre = ‘comedy’;

UPDATE movies

SET Mood = ‘Intense’

WHERE genre != ‘romance’ And genre != ‘comedy’;


FROM movies;