Last Updated: May 12, 2026
For this exercise, we will work with below data:
Write a query that lists every campaign whose date range overlaps with the date range 2024-03-15 to 2024-04-30 (inclusive). Show campaign_id, name, channel, start_date, and end_date. Order by campaign_id.
Write a query that returns every subscription whose date range covers the date 2023-07-01 (inclusive). Treat NULL end_date as an open-ended interval. Show subscription_id, user_id, start_date, and end_date. Order by subscription_id.
Write a query that returns every subscription whose date range overlaps with the date range 2022-01-01 to 2022-12-31 (the year 2022). Show subscription_id, user_id, start_date, and end_date. Order by subscription_id.
Write a query that returns every campaign that does NOT overlap with any other campaign on the same channel. Show campaign_id, name, channel, start_date, and end_date. Order by campaign_id.