Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Genre-Specific Movie Selection | Conditional Filtering and Sorting with CASE WHEN
Mastering CASE WHEN in SQL

bookChallenge: Genre-Specific Movie Selection

Task

Swipe to start coding

Write a query to select all columns from the movies table, but only include rows that meet the following genre-specific criteria:

  • If the genre is 'Action', the rating must be greater than or equal to 7.
  • If the genre is 'Comedy', the rating must be greater than or equal to 6.
  • For all other genres, the rating must be greater than or equal to 8.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 2
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Genre-Specific Movie Selection

Swipe to show menu

Task

Swipe to start coding

Write a query to select all columns from the movies table, but only include rows that meet the following genre-specific criteria:

  • If the genre is 'Action', the rating must be greater than or equal to 7.
  • If the genre is 'Comedy', the rating must be greater than or equal to 6.
  • For all other genres, the rating must be greater than or equal to 8.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 2
single

single

some-alt