Provider Analytics Path · Mission 8 of 30Easy

ED wait time overview

Use WHERE to filter by metric type and calculate aggregate statistics

Back to Provider Analytics

The Brief

Rita VasquezDirector of Patient Experiencepatient-experience

Hi! I just got off a call with a patient family who waited 4 hours in the ED last Tuesday. Can you pull the average, minimum, and maximum ED wait times from our quality metrics? I want to bring data to the nursing leadership meeting tomorrow, not just anecdotes.

You'll practice

AVGMINMAXWHERE

Tables & columns available

fact_quality_metricsfact7 columns
ColumnTypeKey
metric_idINTPK
encounter_idINTFK → fact_encounters
patient_idINTFK → dim_patients
metric_typeTEXT
metric_valueREAL
measurement_dateTEXT
reported_byTEXT

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

Single-row summary with three aggregates side-by-side, scoped by a metric-type filter.

Hint 2

AVG, MIN, and MAX of the metric value, all in one SELECT. Filter the metric type in WHERE; no GROUP BY.

Hint 3

The metric table mixes wait times with other metric types — without the metric_type filter your stats average across unrelated metrics.