Write SQL and Python, run instantly in your browser, and track your progress.
You are a content curator at Netflix. You're tasked with creating a new collection called 'Action Blockbusters' to be featured on the homepage. This collection should only include action films that are currently available for streaming.
Your task is to query the titles table to get a list of all titles that meet these criteria:
content_type must be 'movie'.primary_genre must be 'action'.is_active = 1).The final list should be sorted by release_year in descending order to feature the newest films first. Any ties should be broken by the title_id.
You are a content curator at Netflix. You're tasked with creating a new collection called 'Action Blockbusters' to be featured on the homepage. This collection should only include action films that are currently available for streaming.
Your task is to query the titles table to get a list of all titles that meet these criteria:
content_type must be 'movie'.primary_genre must be 'action'.is_active = 1).The final list should be sorted by release_year in descending order to feature the newest films first. Any ties should be broken by the title_id.
| Column Name | Type |
|---|---|
| title_id | INTEGER |
| title_name | TEXT |
| content_type | TEXT |
| primary_genre | TEXT |
| maturity_rating | TEXT |
| release_year | INTEGER |
| runtime_minutes | INTEGER |
| is_original | INTEGER |
| Column Name | Type |
|---|---|
| title_id | INTEGER |
| title_name | TEXT |
| content_type | TEXT |
| primary_genre | TEXT |
| maturity_rating | TEXT |
| release_year | INTEGER |
| runtime_minutes | INTEGER |
| is_original | INTEGER |
| title_id | title_name | content_type | primary_genre | maturity_rating | release_year | runtime_minutes | is_original | is_active |
|---|---|---|---|---|---|---|---|---|
| 1 | A Walk to Remember | movie | romance | TV-PG | 2023 |
| title_id | title_name | content_type | primary_genre | maturity_rating | release_year | runtime_minutes | is_original | is_active |
|---|---|---|---|---|---|---|---|---|
| 1 | A Walk to Remember | movie | romance | TV-PG | 2023 |
| title_id | title_name | content_type | primary_genre | is_original | release_year |
|---|---|---|---|---|---|
| 23 | Steel Thunder | movie | action | 0 | 2023 |
| 22 | Extraction Point | movie | action | 0 | 2018 |
| 32 | Into the Storm |
| title_id | title_name | content_type | primary_genre | is_original | release_year |
|---|---|---|---|---|---|
| 23 | Steel Thunder | movie | action | 0 | 2023 |
| 22 | Extraction Point | movie | action | 0 | 2018 |
| 32 | Into the Storm |
5 rows returned. These are the active action movies available for streaming.
5 rows returned. These are the active action movies available for streaming.
Your final output should be a result set that meets the following requirements:
1. Filtering:
is_active is 1.content_type is 'movie'.primary_genre is 'action'.2. Columns:
title_idtitle_nameYour final output should be a result set that meets the following requirements:
1. Filtering:
is_active is 1.content_type is 'movie'.primary_genre is 'action'.2. Columns:
title_idtitle_name| is_active | INTEGER |
| is_active | INTEGER |
| 161 |
| 161 |
| 0 |
| 0 |
| 1 |
| 1 |
| 2 | Behind the Algorithm | movie | documentary | PG | 2020 | 163 | 0 | 1 |
| 2 | Behind the Algorithm | movie | documentary | PG | 2020 | 163 | 0 | 1 |
| 3 | Stuck in the Middle | movie | comedy | TV-PG | 2018 | 154 | 0 | 1 |
| 3 | Stuck in the Middle | movie | comedy | TV-PG | 2018 | 154 | 0 | 1 |
| 4 | Threads of Fate | movie | drama | TV-MA | 2016 | 132 | 0 | 0 |
| 4 | Threads of Fate | movie | drama | TV-MA | 2016 | 132 | 0 | 0 |
| 5 | The Bachelor Party | movie | comedy | TV-MA | 2025 | 165 | 1 | 1 |
| 5 | The Bachelor Party | movie | comedy | TV-MA | 2025 | 165 | 1 | 1 |
| movie |
| movie |
| action |
| action |
| 1 |
| 1 |
| 2015 |
| 2015 |
| 35 | Target Acquired | movie | action | 1 | 2014 |
| 35 | Target Acquired | movie | action | 1 | 2014 |
| 20 | Zero Hour | movie | action | 0 | 2000 |
| 20 | Zero Hour | movie | action | 0 | 2000 |
content_typecontent_typeprimary_genreprimary_genreis_originalis_originalrelease_yearrelease_year3. Ordering:
3. Ordering:
release_year in descending order (newest first).title_id in ascending order.release_year in descending order (newest first).title_id in ascending order.