Challenge: Custom Movie Ranking
Oppgave
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
moviestable. - Use
CASE WHENin theORDER BYclause to ensure 'Action' movies withbox_office>= 50000000 appear first. - For movies not meeting the above condition, order them by
ratingin descending order.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 5
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Fantastisk!
Completion rate forbedret til 4.17
Challenge: Custom Movie Ranking
Sveip for å vise menyen
Oppgave
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
moviestable. - Use
CASE WHENin theORDER BYclause to ensure 'Action' movies withbox_office>= 50000000 appear first. - For movies not meeting the above condition, order them by
ratingin descending order.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 5
single