ComenzarEmpieza gratis

Classify film lengths

You want to make browsing easier for users. You've decided to split English-language films into “Short Films” and “Long Films” depending on their duration. Movies under or equal to 90 minutes are short, while anything longer is categorized as long. Films without a known duration should be excluded.

Now it's time to categorize the films accordingly.

Este ejercicio forma parte del curso

Intermediate SQL with AI

Ver curso

Instrucciones del ejercicio

  • Write a prompt to select English films with non-null durations, classifying them as “Short Film” if 90 minutes or less, "Long Film" if over 90 minutes, otherwise "Unknown".
  • Name the new category field as film_type.
  • Display id, title, duration, and the film_type.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

SELECT 
    id, 
    title, 
    duration
FROM films;
Editar y ejecutar código