Sección 1. Capítulo 17
single
Challenge: Custom Movie Ranking
Desliza para mostrar el menú
Tarea
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.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 17
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla