RevOps & Sales Analytics Path · Mission 9 of 34Easy

Average deal size by region

AVG + JOIN + GROUP BY — the per-segment average every regional leader asks for

Back to RevOps & Sales Analytics

The Brief

Teddy OseiDirector of Revenue Operationsrevops

Territory planning. We're sizing FY26 quotas region-by-region and I need a baseline read on average opportunity size per region — the input that anchors capacity modeling. Join opportunities to users, group by `region`, compute average deal size across ALL opportunities (open + closed, every stage — we want the full book, not just historical wins, so newer territories with thin won-history aren't penalized). Return `region` and the rounded `avg_amount`. Order by avg_amount desc.

You'll practice

AVGGROUP BYJOIN

Tables & columns available

revops_opportunitiesfact11 columns
ColumnTypeKey
opportunity_idINTPK
account_idINTFK → revops_accounts
owner_user_idINTFK → revops_users
nameTEXT
stageTEXT
amountREAL
close_dateTEXT
created_dateTEXT
is_closedINT
is_wonINT
forecast_categoryTEXT
revops_usersdim6 columns
ColumnTypeKey
user_idINTPK
full_nameTEXT
role_titleTEXT
regionTEXT
hire_dateTEXT
statusTEXT

Hints (3)

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

Hint 1

INNER JOIN on `owner_user_id = user_id` — same as mission 3. Drop no rows; keep all stages.

Hint 2

Group by `region`. `AVG(amount)`. Round to the nearest dollar with `ROUND(AVG(amount)::numeric, 0)` — Postgres requires the `::numeric` cast on a double-precision input before `ROUND(x, n)` will accept the precision argument.

Hint 3

You should see 5 rows — one per active region that has at least one opportunity. Regions with no opps (e.g. the Director's 'Global' region, since the Director owns zero deals directly) don't appear.