About the “Critical Inpatient ICU Bed Priority Logic” SQL Problem
Business Scenario
The chief medical officer needs to audit patient transfer eligibility for Intensive Care Units (ICU). Patients require immediate ICU transfer if they have oxygen saturation below 90% OR (systolic blood pressure above 180 AND heart rate above 120).
Expected Output & Criteria
Inpatients in clinical distress requiring ICU escalation, sorted by lowest oxygen saturation.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE inpatient_vitals (
patient_id INT PRIMARY KEY,
ward_unit VARCHAR(50) NOT NULL,
oxygen_pct INT NOT NULL,
systolic_bp INT NOT NULL,
heart_rate INT NOT NULL,
requires_ventilator BOOLEAN NOT NULL
);Target SQL Clauses & Operators
Want more Fundamentals practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.