Search ⌘K
DoorDash
DoorDash

Foundations Track · Easy · 15 min

Stockout Days by Warehouse

The inventory team wants to know which warehouses experienced stockouts in July 2024. Return warehouse_id and the number of stockout_days where units_on_hand...

Foundations Track
Easy
15 min
query basics
aggregation
filtering

Company labels are directional practice context, not official interview guidance.

Timer 00:00
Back to practice

Objective

Practice query basics through a DoorDash-tagged business scenario.

Approach

Use this track to lock in clean query structure, basic filtering logic, and confidence with grouped output.

Company context

Company labels are directional practice context, not official interview guidance.

Prereq: query basics
Prereq: filtering

The inventory team wants to know which warehouses experienced stockouts in July 2024. Return warehouse_id and the number of stockout_days where units_on_hand was zero. Show only warehouses with at least one stockout day. Sort by stockout_days descending, then warehouse_id.

inventory_snapshots
warehouse_id INT
snapshot_date DATE
units_on_hand INT
warehouse_idsnapshot_dateunits_on_hand
12024-07-0114
12024-07-020
12024-07-030
22024-07-018
22024-07-025
32024-07-010
32024-07-027
Editor
SQL workspace

Run queries against the protected question data, then submit once the result shape looks right.

Sign in to run SQL

Create a free account or sign in before running queries against protected question data.