Zacznij terazZacznij za darmo

Categorize film certifications

You have an idea to group films into audience categories that will help simplify browsing. Films with certifications like G, PG, Approved, Passed, or GP should be labeled for kids. All other films will fall into a general "Other" category.

You need to generate this classification and sort the list.

To ćwiczenie jest częścią kursu

Intermediate SQL Querying with AI

Zobacz kurs

Instrukcje do ćwiczenia

  • Write a prompt that classifies films into “Kids” if their certification is G, PG, Approved, Passed, or GP, otherwise label them “Other”.
  • Name the new category audience_segment.
  • Order the results by this new category in descending order, then by alphabetical film title.

Interaktywne ćwiczenie praktyczne

Spróbuj tego ćwiczenia, uzupełniając ten przykładowy kod.

SELECT
  title,
  certification
FROM films;
Edytuj i uruchom kod