Use IS NULL to identify unattributed organic conversions
Not every purchase is tied to a campaign. How many purchases happened organically — meaning no campaign_id attached? I need the count and total revenue. Exclude refunds. This tells us what we earn without any marketing spend.
Each hint you reveal reduces the XP you can earn. Try the query first.
Organic = no campaign. Filter `fact_purchases` with `WHERE campaign_id IS NULL AND amount > 0`
Important: use `IS NULL`, not `= NULL` — the equals operator doesn't work with NULL in SQL
Aggregate both metrics in one query: `COUNT(*) AS organic_purchases, ROUND(SUM(amount)::numeric, 2) AS organic_revenue`