Live and churned MRR per tier

SQLMedium11 min

Your task

For each account tier, return tier, live_mrr and churned_mrr. Order by tier.

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