Marketing Analytics Path · Mission 15 of 25Medium

What's our average order value per campaign?

Use AVG with GROUP BY to compare campaign efficiency

Back to Marketing Analytics

The Brief

Marcus BellHead of Growthanalytics-help

I want to compare campaigns by average order value, not just total revenue. Can you pull campaign_name, order count, and average order value? Exclude refunds. Sort by AOV descending.

You'll practice

AVGGROUP BY

Tables available

fact_purchasesdim_campaigns

Hints (3)

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

Hint 1

JOIN `fact_purchases` to `dim_campaigns` on `campaign_id` and filter `WHERE p.amount > 0`

Hint 2

Use `AVG(p.amount)` for average order value — round it with `ROUND(AVG(p.amount)::numeric, 2) AS avg_order_value`

Hint 3

Also include `COUNT(*) AS orders` and GROUP BY campaign_name. Sort by avg_order_value DESC