Subscription Commerce Analytics Path · Mission 2 of 25Easy

Active subscribers by country

First INNER JOIN. Practice joining a fact (snapshots) to a dim (customers) on customer_id, filtering on two columns at once (snapshot_date AND state), and counting distinct values inside an aggregation.

The Brief

Devon ParkSenior Analyst, Lifecyclesubscription-ops

International expansion review with the CEO at 2 PM. From the latest snapshot ('2026-03-31'), I need the count of active subscribers grouped by country. We only want state = 'active' — paused subs aren't paying right now and the CEO will conflate them with churned. Two columns: country, active_count. Sort active_count descending, country ascending as tiebreaker.

You'll practice

INNER JOINGROUP BYCOUNT

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_customersdim8 columns
ColumnTypeKey
customer_idINTPK
emailTEXT
first_nameTEXT
last_nameTEXT
countryTEXT
signup_dateTEXT
acquisition_channelTEXT
is_subscriberINT

Hints (3)

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

Hint 1

Snapshot filter plus a state filter — fact_subscription_snapshots has rows for both 'active' and 'paused' subs each day; we only want 'active' here.

Hint 2

JOIN dim_customers on customer_id to pull the country column. INNER JOIN is fine — every snapshot row has a valid customer.

Hint 3

COUNT(DISTINCT subscription_id) is safer than COUNT(*) — even though one subscription is one row per snapshot date, defensive analysts always count distinct on the entity grain.