First SUM aggregation against monetary data. Practice JOIN to a small dim, GROUP BY a denormalized attribute (plan_family from dim_plans, not stored on the snapshot), and using ROUND(value, 2) to produce CFO-readable totals.
Board prep — I need MRR broken down by plan_family for the latest snapshot ('2026-03-31'). Active subs only; paused don't contribute MRR. Two columns: plan_family, mrr_total. Round mrr_total to 2 decimals so it pastes cleanly into the deck. Sort mrr_total descending, plan_family ascending.
| Column | Type | Key |
|---|---|---|
| snapshot_date | TEXT | PK |
| subscription_id | INT | PKFK → fact_subscriptions |
| customer_id | INT | FK → dim_customers |
| state | TEXT | |
| plan_id | INT | FK → dim_plans |
| mrr | REAL | |
| paused_until | TEXT |
| Column | Type | Key |
|---|---|---|
| plan_id | INT | PK |
| plan_family | TEXT | |
| cadence | TEXT | |
| monthly_price | REAL | |
| display_name | TEXT |
Each hint you reveal reduces the XP you can earn. Try the query first.
Snapshot filter + state filter — same pattern as before. snapshot_date = '2026-03-31' AND state = 'active'.
plan_family lives on dim_plans, not on the snapshot. Join on plan_id.
SUM(s.mrr) totals the per-subscription MRR across the family. Wrap in ROUND(..., 2) since SUM on REAL can carry floating-point dust.