About the “ICU Patient Rolling 3-Reading Systolic Moving Average” SQL Problem
Business Scenario
Intensive Care Unit (ICU) clinical telemetry uses moving averages across consecutive vital signs to filter out momentary measurement artifacts and detect true hemodynamic trends.
Expected Output & Criteria
Rolling systolic moving average per patient across consecutive readings.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMCREATE TABLE patient_vitals (
reading_id INT PRIMARY KEY,
patient_id INT NOT NULL,
reading_time TIMESTAMP NOT NULL,
systolic_bp INT NOT NULL
);Target SQL Clauses & Operators
Want more Window Functions practice?
Explore the full syllabus of 18 exercises and syntax guides.