About the “Warehouse Inventory Stockout Risk & Reorder Priority” SQL Problem
Business Scenario
Warehouse fulfillment automated replenishment systems compare current available on-hand stock against 7-day average daily sales velocity to calculate estimated days of supply.
Expected Output & Criteria
At-risk inventory items with 10 or fewer days of remaining stock.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE warehouse_stock (
sku VARCHAR(20) PRIMARY KEY,
product_name VARCHAR(100) NOT NULL,
current_stock INT NOT NULL,
daily_sales NUMERIC(6, 2) NOT NULL
);Target SQL Clauses & Operators
WITHROUNDORDER BY
Want more CTEs practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.