About the “3-Day Rolling Sales Moving Average” SQL Problem
Business Scenario
Demand planning requires smoothing out day-of-week sales fluctuations. Supply chain analysts use a 3-day trailing moving average to forecast warehouse fulfillment staffing.
Expected Output & Criteria
Daily sales alongside 3-day rolling window average.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE daily_sales (
sale_date DATE PRIMARY KEY,
daily_amount NUMERIC(10, 2) NOT NULL
);Target SQL Clauses & Operators
AVGOVERPRECEDINGROUND
Want more Window Functions practice?
Explore the full syllabus of 14 exercises, syntax guides, and interview pitfalls.