Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Release Year Priority | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Mastering CASE WHEN in SQL
SectionΒ 1. ChapterΒ 18
single

single

bookChallenge: Release Year Priority

Swipe to show menu

Task

Swipe to start coding

Write a query to retrieve all columns from the movies table and order the results so that movies with genre 'Sci-Fi' released after 2010 appear first. All other movies should follow, ordered by release_year in descending order.

  • Use a CASE WHEN statement in the ORDER BY clause to assign the highest priority to movies where genre is 'Sci-Fi' and release_year is greater than 2010.
  • Order the remaining movies by release_year in descending order.

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Β 1. ChapterΒ 18
single

single

Ask AI

expand

Ask AI

ChatGPT

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

some-alt