Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Blockbuster Filter | Conditional Filtering and Sorting with CASE WHEN
Mastering CASE WHEN in SQL
Section 3. Chapter 3
single

single

Challenge: Blockbuster Filter

Swipe to show menu

Task

Swipe to start coding

Write a query that selects the title, genre, rating, and box_office columns from the movies table. Use a CASE WHEN expression to add a column that labels each movie as 'Blockbuster' if its box_office is greater than or equal to 100,000,000 or its rating is greater than or equal to 8.5. Otherwise, label it as 'Standard'.

  • Select the columns title, genre, rating, and box_office from the movies table.
  • Add a column using a CASE WHEN expression to label each movie as 'Blockbuster' or 'Standard' based on the criteria above.
  • Name the new column blockbuster_status.

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 3
single

single

Ask AI

expand

Ask AI

ChatGPT

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

some-alt