Clean-Rated Audiobooks Aired in March
Problem
An audio streaming service stores a broadcast schedule and a catalog of episodes.
Table: `Schedule`
```text
+----------+---------+
| Column | Type |
+----------+---------+
| air_time | date |
| ep_id | int |
| station | varchar |
+----------+---------+
Each row says an episode aired at a given time on a station.
```
Table: `Catalog`
```text
+------------+---------+
| Column | Type |
+------------+---------+
| ep_id | varchar |
| ep_title | varchar |
| family_safe| varchar |
| format | varchar |
+------------+---------+
family_safe is 'Y' or 'N'. format is one of 'Audiobook', 'Podcast', etc.
```
Return the distinct titles of episodes that are family-safe ('Y'), are in the 'Audiobook' format, and aired at any point in March 2021 (between 2021-03-01 and 2021-03-31). Name the column `ep_title`.
Tables
Example rows — the live problem includes the full dataset.
| air_time | ep_id | station |
|---|---|---|
| 2021-03-10 08:00 | 1 | Wave-FM |
| 2021-02-11 12:00 | 2 | Wave-FM |
| 2021-02-12 12:00 | 3 | Wave-FM |
| ep_id | ep_title | family_safe | format |
|---|---|---|---|
| 1 | Market Watch | N | Audiobook |
| 2 | Tales for Cubs | Y | Podcast |
| 3 | Query School | N | Podcast |
Expected output
Your answer should return 1 row with the columns ep_title.
Starter code (SQL)
SELECT *
FROM Schedule;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock