About the “Emergency Department Wait Time Quartiles with NTILE(4)” SQL Problem
Business Scenario
Hospital quality assurance audits emergency department throughput. Patients are bucketed into wait-time quartiles to measure clinical delay across triage shifts.
Expected Output & Criteria
ER patients categorized into 4 wait time quartiles.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE er_throughput (
patient_id INT PRIMARY KEY,
triage_acuity VARCHAR(30) NOT NULL,
wait_minutes INT NOT NULL
);Target SQL Clauses & Operators
NTILEOVERORDER BY
Want more Window Functions practice?
Explore the full syllabus of 14 exercises, syntax guides, and interview pitfalls.