Quick Commerce Analytics Path · Mission 1 of 25Easy

Orders by merchant

First look at fact_orders, the hub of the three-sided marketplace. Practice a single-table GROUP BY + COUNT to surface order volume per merchant. The foundational shape every quick-commerce analyst writes before any deeper question.

The Brief

Diego RamirezMerchant Operations Leadmerchant-ops

Welcome to the team. Before anything fancy, pull me a count of orders per merchant so I can see who our heavy hitters are. fact_orders has one row per order with a merchant_id on it. Two columns: merchant_id, order_count. ORDER BY order_count DESC, merchant_id ASC so reruns are stable. Just the raw counts, nothing weighted yet.

You'll practice

SELECTGROUP BYCOUNT

Tables & columns available

fact_ordersfact18 columns
ColumnTypeKey
order_idINTPK
customer_idINTFK → dim_customers
merchant_idINTFK → dim_merchants
shopper_idINTFK → dim_shoppers
dispatch_idINTFK → fact_shopper_dispatches
order_tsTEXT
order_statusTEXT
unitsINT
item_subtotalREAL
delivery_feeREAL
service_feeREAL
surge_feeREAL
surge_multiplierREAL
tip_amountREAL
customer_totalREAL
shopper_takeREAL
platform_takeREAL
merchant_payoutREAL

Hints (3)

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

Hint 1

Everything you need is in fact_orders, no joins yet.

Hint 2

GROUP BY merchant_id and COUNT(*) the rows in each group.

Hint 3

Give the count an alias so you can sort by it, then add merchant_id as a tiebreaker so rows with equal counts always come back in the same order.