Subscription Commerce Analytics Path · Mission 9 of 25Medium

ARPU by plan

AVG aggregation with a JOIN to a denormalized dim attribute. Practice using SUM/COUNT vs AVG (both produce the same answer here; AVG is idiomatic for the question). Reinforces the latest-snapshot + active filter pattern.

The Brief

Felix TanakaPricing Analystsubscription-ops

Pricing committee meets Thursday — I need ARPU (average revenue per subscriber) by plan as of the latest snapshot ('2026-03-31'), active state only. Two columns: display_name (from dim_plans), arpu (rounded to 2 decimals). Sort arpu descending, display_name ascending. ARPU should match the plan's monthly_price for active subs since one sub on plan X pays plan X's price — sanity check the output against dim_plans.monthly_price.

You'll practice

SUM/COUNTGROUP BYNULL guard

Tables & columns available

fact_subscription_snapshotsfact7 columns
ColumnTypeKey
snapshot_dateTEXTPK
subscription_idINTPKFK → fact_subscriptions
customer_idINTFK → dim_customers
stateTEXT
plan_idINTFK → dim_plans
mrrREAL
paused_untilTEXT
dim_plansdim5 columns
ColumnTypeKey
plan_idINTPK
plan_familyTEXT
cadenceTEXT
monthly_priceREAL
display_nameTEXT

Hints (4)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

AVG(s.mrr) computes ARPU directly. It will equal the plan's monthly_price exactly because every active sub on a given plan has mrr = monthly_price.

Hint 2

INNER JOIN dim_plans on plan_id to pull the display_name.

Hint 3

Same snapshot filter pattern as before: snapshot_date = '2026-03-31' AND state = 'active'.

Hint 4

ROUND(AVG(s.mrr)::numeric, 2) for clean output.