LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Intermediate SQL with AI

Kurs anzeigen

Anleitung zur Übung

  • 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.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

SELECT 
    id, 
    title, 
    duration
FROM films;
Code bearbeiten und ausführen