Omnichannel Retail Analytics Path · Mission 5 of 25Easy

Shipping SLA by carrier — January 2026

Date arithmetic across two timestamps in different tables. JOIN, AVG, ROUND. The carrier scorecard shape ops teams write weekly.

Back to Omnichannel Retail Analytics

The Brief

Marcus ChenRegional Directorretail-ops

Need a January 2026 SLA cut by carrier — average hours between order_ts and the first 'shipped' event for web_ship orders. Three columns: carrier, avg_hours_to_ship. ROUND to 1 decimal. ORDER BY avg_hours_to_ship ASC (fastest carrier first), then carrier ASC for ties. Only event_type = 'shipped' (drop the split-ship 'in_transit' secondaries).

You'll practice

Date arithmeticAVGWHERE

Tables & columns available

fact_fulfillment_eventsfact7 columns
ColumnTypeKey
event_idINTPK
order_idINTFK → fact_orders
event_typeTEXT
event_tsTEXT
carrierTEXT
zoneINT
costREAL
fact_ordersfact10 columns
ColumnTypeKey
order_idINTPK
sku_idINTFK → dim_skus
store_idINTFK → dim_stores
channelTEXT
customer_zipTEXT
order_tsTEXT
unitsINT
gross_amountREAL
discount_amountREAL
fulfillment_costREAL

Hints (4)

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

Hint 1

JOIN fact_fulfillment_events to fact_orders on order_id.

Hint 2

Filter event_type = 'shipped' AND event_ts between 2026-01-01 and 2026-02-01 (half-open).

Hint 3

EXTRACT(EPOCH FROM (event_ts::timestamp - o.order_ts::timestamp)) / 3600 gives hours.

Hint 4

ROUND(AVG(...)::numeric, 1) for clean output.