The latest subscription per account, without a window

SQLHard14 min

Your task

For each account, return its most recently started subscription. Give name, started_on and mrr_cents, ordered by name. Solve it without a window function.

Tables

account
idINTEGERnameTEXTtierTEXT
1Northwindteam
2Acmesolo
3Globexteam
4Initechsolo
subscription
idINTEGERaccount_idINTEGERstarted_onTEXTcancelled_onTEXTmrr_centsINTEGER
112025-06-01NULL49000
222025-08-152026-01-319000
332025-09-01NULL49000
442026-01-052026-02-209000
522026-02-01NULL19000