Who was subscribed on a given day
SQLHard15 min
Your task
Return the accounts with an active subscription on 2026-01-15: started on or before that date, and not cancelled before it. Give name, alphabetically.
Tables
account| idINTEGER | nameTEXT | tierTEXT |
|---|
| 1 | Northwind | team |
| 2 | Acme | solo |
| 3 | Globex | team |
| 4 | Initech | solo |
| 5 | Umbrella | solo |
| 6 | Hooli | team |
More rows not shown subscription| idINTEGER | account_idINTEGER | started_onTEXT | cancelled_onTEXT | mrr_centsINTEGER |
|---|
| 1 | 1 | 2025-06-01 | NULL | 49000 |
| 2 | 2 | 2025-08-15 | 2026-01-31 | 9000 |
| 3 | 3 | 2025-09-01 | NULL | 49000 |
| 4 | 4 | 2026-01-05 | 2026-02-20 | 9000 |
| 5 | 2 | 2026-02-01 | NULL | 19000 |
| 6 | 5 | 2026-01-16 | NULL | 9000 |
More rows not shown Model answerRun