Quick Commerce Analytics Path · Mission 10 of 25Medium

Batch-size distribution

Read the batching mechanic directly off fact_shopper_dispatches.batch_size with a simple distribution. Sets up the batching-economics missions in the Pro tier.

Back to Quick Commerce Analytics

The Brief

Sam OkaforOperations Leadops

Quick one. Each dispatch fulfills one, two, or three orders, that's the batch_size. I want the distribution: how many dispatches fall in each batch size. Columns: batch_size, dispatch_count. ORDER BY batch_size.

You'll practice

COUNT per dispatchGROUP BY batch_sizeDistribution

Tables & columns available

fact_shopper_dispatchesfact10 columns
ColumnTypeKey
dispatch_idINTPK
shopper_idINTFK → dim_shoppers
dispatch_tsTEXT
pickup_tsTEXT
deliver_tsTEXT
batch_sizeINT
pick_to_deliver_minutesINT
dispatch_statusTEXT
total_distance_miREAL
shopper_payoutREAL

Hints (3)

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

Hint 1

batch_size already lives on fact_shopper_dispatches, no counting of child orders needed.

Hint 2

GROUP BY batch_size and COUNT(*) the dispatches.

Hint 3

ORDER BY batch_size so it reads 1, 2, 3.