Challenge: Blockbuster Filter
Swipe to start coding
Write a query that selects all movies from the movies table and labels each 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, using a CASE WHEN expression for this logic. Only include movies that meet the blockbuster criteria in the result set.
- Use a
CASE WHENexpression in theWHEREclause to filter movies wherebox_officeis greater than or equal to 100,000,000 orratingis greater than or equal to 8.5. - In the
SELECTlist, use aCASE WHENexpression to label each included movie as'Blockbuster'or'Standard'based on the same criteria. - Return the columns
title,genre,rating,box_office, and the blockbuster label asblockbuster_status.
Ratkaisu
Kiitos palautteestasi!
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 4.17
Challenge: Blockbuster Filter
Pyyhkäise näyttääksesi valikon
Swipe to start coding
Write a query that selects all movies from the movies table and labels each 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, using a CASE WHEN expression for this logic. Only include movies that meet the blockbuster criteria in the result set.
- Use a
CASE WHENexpression in theWHEREclause to filter movies wherebox_officeis greater than or equal to 100,000,000 orratingis greater than or equal to 8.5. - In the
SELECTlist, use aCASE WHENexpression to label each included movie as'Blockbuster'or'Standard'based on the same criteria. - Return the columns
title,genre,rating,box_office, and the blockbuster label asblockbuster_status.
Ratkaisu
Kiitos palautteestasi!
single