Omnichannel Retail Analytics Path · Mission 10 of 25Medium

Inventory turns by store-SKU — hot SKUs, H2

Multi-CTE pipeline. AVG inventory + SUM sold across the same 6-month window. Ratio of velocity to inventory. The fundamental inventory metric every merchandiser reads weekly.

Back to Omnichannel Retail Analytics

The Brief

Devon ParkInventory Leadinventory

Buying-window review. For each (store, hot SKU) pair, compute inventory turns over Oct 2025 → Mar 2026 (6 months): units sold / average daily units on hand. Top 10 by turns. Five columns: store_name, product_title, units_sold, avg_inv, turns. ROUND avg_inv to 1 decimal, turns to 2 decimals. ORDER BY turns DESC, store_id ASC, sku_id ASC for ties. Only is_hot_inventory = 1 SKUs (the 20 we track daily).

You'll practice

VelocityDate mathJOIN

Tables & columns available

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
fact_inventory_by_locationfact5 columns
ColumnTypeKey
snapshot_idINTPK
store_idINTFK → dim_stores
sku_idINTFK → dim_skus
snapshot_dateTEXT
units_on_handINT
dim_storesdim7 columns
ColumnTypeKey
store_idINTPK
store_nameTEXT
regionTEXT
cityTEXT
stateTEXT
sq_ftINT
opened_dateTEXT
dim_skusdim8 columns
ColumnTypeKey
sku_idINTPK
sku_codeTEXT
product_titleTEXT
categoryTEXT
supplier_costREAL
list_priceREAL
weight_lbsREAL
is_hot_inventoryINT

Hints (4)

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

Hint 1

Two CTEs: `sold` (SUM units from fact_orders, filtered to the 6-month window + units > 0 + store_id NOT NULL) and `inv` (AVG units_on_hand from fact_inventory_by_location in the same window).

Hint 2

JOIN sold + inv on (store_id, sku_id), then JOIN to dim_stores + dim_skus for names.

Hint 3

Filter dim_skus.is_hot_inventory = 1 in the outer SELECT.

Hint 4

turns = units_sold / NULLIF(avg_inv, 0).