E-commerce & Retail Analytics Path · Mission 6 of 30Easy

Revenue by financial status

Use GROUP BY with SUM to roll up monetary totals per category. The first 'where does our money actually live across lifecycle states' query — the question every CFO asks before close.

The Brief

Tomás BergerCFOfinance-ops

Pre-close ask. For my variance memo I need to see total `total_price` summed up per `financial_status` value. One row per status, with the dollar total alongside, ordered by total descending. Use `ecom_orders`. I expect `paid` to be the bulk; the question is how big the partial-refund and pending columns are. We're closing Q1 next week and I want eyes on each bucket.

You'll practice

GROUP BYSUM

Tables & columns available

ecom_ordersfact13 columns
ColumnTypeKey
order_idINTPK
customer_idINTFK → ecom_customers
order_numberTEXT
financial_statusTEXT
fulfillment_statusTEXT
total_priceREAL
subtotalREAL
taxREAL
shippingREAL
discount_totalREAL
channelTEXT
created_dateTEXT
processed_dateTEXT

Hints (3)

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

Hint 1

`GROUP BY financial_status` collapses 100 order rows into one row per status.

Hint 2

`SELECT financial_status, SUM(total_price) AS revenue FROM ecom_orders GROUP BY financial_status ORDER BY revenue DESC`. Seven rows.

Hint 3

The CFO will care that pending + authorized + partially_paid together represent ~$1.6K — that's the Q-end accrual question. Paid is the bulk by an order of magnitude.