Clinical Trials & Research Analytics Path · Mission 8 of 25Medium

Phase-3 trial roster

On-ramp to Medium tier: a three-table INNER JOIN is the only new mechanic over the Easy missions — no window functions, no CTEs. Practice navigating dim → bridge dim → fact, applying a WHERE clause on the parent dim, and aggregating on the fact, with a stable two-key sort. This is the canonical 'roster' shape that every Medium/Hard mission later builds on.

The Brief

Priya KumarTrial Operations Managerslack-dm

Steering committee wants a phase-3-only roster: every phase-3 trial, every arm in that trial, and how many patients are on each arm. From dim_trials WHERE phase = 3, joined to dim_protocols on trial_id, joined to fact_enrollments on protocol_id (and trial_id, to be safe). Output trial_name, arm_name, enrolled — sorted by trial_name then arm_name so the roster reads cleanly down the page. Don't filter on enrollment status; we want every randomized patient in the count.

You'll practice

3-table INNER JOINDimension filterGROUP BYCOUNT(*)

Tables & columns available

dim_trialsdim10 columns
ColumnTypeKey
trial_idINTPK
nct_idTEXT
trial_nameTEXT
phaseINT
conditionTEXT
therapeutic_areaTEXT
sponsorTEXT
statusTEXT
start_dateTEXT
end_dateTEXT
dim_protocolsdim6 columns
ColumnTypeKey
protocol_idINTPK
trial_idINTFK → dim_trials
arm_nameTEXT
intervention_typeTEXT
atc_classTEXT
versionTEXT
fact_enrollmentsfact8 columns
ColumnTypeKey
enrollment_idINTPK
trial_idINTFK → dim_trials
protocol_idINTFK → dim_protocols
patient_idINTFK → dim_trial_patients
site_idINTFK → dim_sites
enrolled_dateTEXT
statusTEXT
withdrawal_reasonTEXT

Hints (3)

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

Hint 1

Three-table inner join through trials → protocols → enrollments. Filter on the trial's phase column at the parent dimension.

Hint 2

Group by the trial name and the arm name; aggregate is a row count per (trial, arm) combination. Name it for the metric.

Hint 3

Sort alphabetically on trial then arm so the roster reads down the page. Six phase-3 trials with two-to-three arms each gives a row count in the low double digits.