0
← Exercises/
Fundamentals•3 of 12
FundamentalsBeginner

Emergency Room Urgent Triage Filtering

Scenario

MetroHealth Hospital's emergency department is handling a surge of incoming patients. Charge nurses need an immediate list of patients classified under high-urgency triage levels ('Resuscitation' and 'Emergent') who are still awaiting clinical examination.

Task
Query the `emergency_visits` table for patients who have status `'waiting'` and are classified under triage levels `'Resuscitation'` or `'Emergent'`. Return the following columns: 1. `visit_id` 2. `patient_name` 3. `triage_level` 4. `vital_pulse` 5. `arrival_time` Order results by `arrival_time` ascending so the earliest arrivals are attended to first.
Expected Output Format

List of waiting emergency patients under Resuscitation or Emergent triage, sorted chronologically.

Input Tables & Sample Data0 tables
Loading database schema...
Need a hint?
query.sql|Local Sandbox
Loading SQL editor...
Click "Run" or press ⌘ + Enter to execute your query

About the “Emergency Room Urgent Triage Filtering” SQL Problem

Business Scenario

MetroHealth Hospital's emergency department is handling a surge of incoming patients. Charge nurses need an immediate list of patients classified under high-urgency triage levels ('Resuscitation' and 'Emergent') who are still awaiting clinical examination.

Expected Output & Criteria

List of waiting emergency patients under Resuscitation or Emergent triage, sorted chronologically.

Database Table Schema (PostgreSQL DDL)

PostgreSQL 16 WASM

This challenge executes directly against the following relational schema in your browser:

CREATE TABLE emergency_visits (
        visit_id VARCHAR(10) PRIMARY KEY,
        patient_name VARCHAR(100) NOT NULL,
        triage_level VARCHAR(30) NOT NULL,
        status VARCHAR(20) NOT NULL,
        vital_pulse INT NOT NULL,
        arrival_time TIMESTAMP NOT NULL
      );

Target SQL Clauses & Operators

WHEREINORDER BY

Want more Fundamentals practice?

Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.

View Fundamentals Track→