Practice the SQL patterns pharma commercial analysts run at Pfizer / Lilly / Novartis / Veeva: top prescribers by NRx, decile-based HCP segmentation, NRx vs TRx breakdowns, call-to-Rx attribution lag, territory market share HHI, switcher cohorts, persistence curves, and brand-launch performance scorecards. Per-Rx-claim grain on 24 months of data spanning a single-brand launch + in-class competitors. The patterns life-sciences commercial teams interview on.
25 missions (10 free · 15 Pro incl. 5 Master) · 7 tables · IQVIA-style Rx + HCP + rep + payer schema
Read the briefing
A Slack message from your manager
Explore the schema
5 tables in a star schema
Write your query
Full SQL editor with autocomplete
Get expert feedback
Graduated hints, not just pass/fail
Per-Rx-claim grain (NRx vs TRx flag, days_supply, copay), HCP/NPI dimension with decile + target flag + specialty, rep activity with sample drops, payer plans by formulary tier, and normalized territory FK that mirrors how real IQVIA / Veeva / Komodo datasets are shaped.
Single launch brand (Cardiozin, a new statin) entered market month 17 of a 24-month window; 2-3 in-class competitors hold incumbent share; 5-6 unrelated products provide portfolio breadth. Every mission can hook into 'how is our launch tracking vs. competition?' — the same question every brand team asks every Monday.
Per-fill is_new_rx flag enables the canonical NRx (new prescriptions) vs TRx (total prescriptions including refills) split that drives every commercial dashboard. Days-supply distributions, refill-rate cohorts, and time-to-discontinuation curves — the patterns brand teams use to detect adherence and switching.
Multi-CTE brand performance scorecards, rep effectiveness paired pivots (calls vs. Rx delta), territory market-share HHI, multi-touch attribution sequences (call → sample → Rx), and HCP segmentation capstones with multi-metric ranks. The SQL pharma commercial analytics teams interview on.
Each mission is a real request from someone at the company. Difficulty increases as you go.
Pharma commercial dataset modeled on IQVIA / Veeva / Komodo-shape Rx ledgers. 24-month window (2024-05-01 → 2026-04-30) covering a single-brand launch (Cardiozin, a new statin entering market 2025-09-01) plus 2-3 in-class competitors holding incumbent share, plus 5-6 unrelated products for portfolio breadth. Per-Rx-claim grain in fact_rx with is_new_rx flag (NRx vs TRx), days_supply, quantity, and copay. fact_calls captures rep activity at HCP grain with sample drops embedded. dim_hcp carries decile + target flag + specialty + territory_id; dim_rep is anchored to a territory; geography reaches Rx and calls only via the HCP join (a Hard-tier teaching point). All tables are net-new; no overlap with the provider, clinical-ops, clinical-trials, or payer-claims paths.
●dimension tables ● fact tables
The patterns life-sciences brand teams interview on — on a real-shape Rx + HCP + rep dataset.
Looking for something different?