Začněte nyníZačněte zdarma

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.

Toto cvičení je součástí kurzu

Intermediate SQL Querying with AI

Zobrazit kurz

Pokyny k cvičení

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

Interaktivní cvičení na vyzkoušení si v praxi

Vyzkoušejte si toto cvičení dokončením tohoto ukázkového kódu.

SELECT 
    id, 
    title, 
    duration
FROM films;
Upravit a spustit kód