Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Custom Movie Ranking | Conditional Filtering and Sorting with CASE WHEN
Practice
Projects
Quizzes & Challenges
Quizzen
Challenges
/
Mastering CASE WHEN in SQL

bookChallenge: Custom Movie Ranking

Taak

Swipe to start coding

Write a query that ranks movies using a custom rule. 'Action' movies with a box_office greater than or equal to 50000000 should come first. All other movies should follow, ordered by rating in descending order.

  • Select all columns from the movies table.
  • Use CASE WHEN in the ORDER BY clause to ensure 'Action' movies with box_office >= 50000000 appear first.
  • For movies not meeting the above condition, order them by rating in descending order.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 5
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

close

bookChallenge: Custom Movie Ranking

Veeg om het menu te tonen

Taak

Swipe to start coding

Write a query that ranks movies using a custom rule. 'Action' movies with a box_office greater than or equal to 50000000 should come first. All other movies should follow, ordered by rating in descending order.

  • Select all columns from the movies table.
  • Use CASE WHEN in the ORDER BY clause to ensure 'Action' movies with box_office >= 50000000 appear first.
  • For movies not meeting the above condition, order them by rating in descending order.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 5
single

single

some-alt