Marketplace Seller Analytics Path · Mission 7 of 25Medium

Marketplace fee breakdown by type

First multi-column SUM aggregation. Practice computing four parallel SUM columns from one table scan, joining a fact (settlements) through another fact (orders) to a dim (marketplaces), and rounding monetary totals for board-pack output.

Back to Marketplace Seller Analytics

The Brief

Eleanor VossCFOmarketplace-ops

Board-prep all-time fee breakdown by marketplace. From fact_settlements, sum the four fee categories (marketplace_fee, ad_fee, fulfillment_fee, refund_amount) per marketplace. Five columns: marketplace_name, marketplace_fee_total, ad_fee_total, fulfillment_fee_total, refund_total — all rounded to 2 decimals. Sort marketplace_fee_total descending, marketplace_name ascending. The board sees this every quarter — it's the GMV-vs-payout reconciliation in summary form (M16 builds the full reconciliation with payout).

You'll practice

CASE aggregationGROUP BYFee categories

Tables & columns available

fact_settlementsfact9 columns
ColumnTypeKey
settlement_idINTPK
order_idINTFK → fact_orders
settle_tsTEXT
gross_amountREAL
marketplace_feeREAL
ad_feeREAL
fulfillment_feeREAL
refund_amountREAL
net_payoutREAL
fact_ordersfact7 columns
ColumnTypeKey
order_idINTPK
listing_idINTFK → dim_listings
marketplace_idINTFK → dim_marketplaces
order_tsTEXT
unitsINT
gross_amountREAL
refundedINT
dim_marketplacesdim4 columns
ColumnTypeKey
marketplace_idINTPK
marketplace_nameTEXT
marketplace_fee_pctREAL
fba_supportedINT

Hints (4)

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

Hint 1

Join fact_settlements → fact_orders (on order_id) → dim_marketplaces (on marketplace_id).

Hint 2

Four parallel ROUND(SUM(...), 2) for each fee category.

Hint 3

GROUP BY marketplace_name so each platform gets its own row with the fee components.

Hint 4

Sort marketplace_fee_total DESC — the highest-fee platform leads the discussion.