0
← Exercises/
Business Analytics•6 of 14
Business AnalyticsAdvancedPRO

Emergency Department Conversion Funnel to Inpatient Admission

Scenario

Hospital executive boards monitor emergency triage drop-off: how many presenting ER patients are triaged, examined by a physician, and ultimately admitted to inpatient hospital beds.

Task
Analyze patient records in `er_patient_journey`. Calculate: 1. `total_arrivals`: Count of all patient visits 2. `physician_examined`: Count where `examined_by_md = true` 3. `inpatient_admitted`: Count where `admitted_to_ward = true` 4. `admission_rate_pct`: Percentage of arrivals that converted to inpatient admission: `ROUND(100.0 * COUNT(*) FILTER (WHERE admitted_to_ward = true) / COUNT(*), 1)` Return in a single summary row.
Expected Output Format

Conversion funnel counts and admission rate percentage from the emergency department.

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 Department Conversion Funnel to Inpatient Admission” SQL Problem

Business Scenario

Hospital executive boards monitor emergency triage drop-off: how many presenting ER patients are triaged, examined by a physician, and ultimately admitted to inpatient hospital beds.

Expected Output & Criteria

Conversion funnel counts and admission rate percentage from the emergency department.

Database Table Schema (PostgreSQL DDL)

PostgreSQL 16 WASM

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

CREATE TABLE er_patient_journey (
        visit_id INT PRIMARY KEY,
        patient_mrn VARCHAR(20) NOT NULL,
        examined_by_md BOOLEAN NOT NULL,
        admitted_to_ward BOOLEAN NOT NULL
      );

Target SQL Clauses & Operators

COUNTROUND

Want more Business Analytics practice?

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

View Business Analytics Track→