Payer Claims & Appeals Analytics Path · Mission 3 of 25Easy

Top 5 specialties by claim count

Two-table join from fact to dimension to surface a categorical attribute, then ranked LIMIT output. Practice JOIN to dim_providers_payer on provider_id, GROUP BY on the dimension attribute, ORDER BY DESC, LIMIT — the ranked-list pattern behind every network-management report.

The Brief

Priya ShahNetwork Management Leadslack-dm

Network team is mapping where contracting spend goes next quarter. From fact_claims joined to dim_providers_payer, give me the top 5 specialties ranked by claim count — specialty and claim_count, descending. The provider table has the specialty attribute; claims only carry the provider key. This drives our renegotiation priorities — the specialties at the top of this list are where a 1% rate concession moves the needle, and where we want to be sharpest before contracts open.

You'll practice

INNER JOINGROUP BYORDER BY DESCLIMIT

Tables & columns available

fact_claimsfact11 columns
ColumnTypeKey
claim_idINTPK
member_idINTFK → dim_members
provider_idINTFK → dim_providers_payer
plan_idINTFK → dim_plans
service_dateTEXT
cpt_codeTEXT
place_of_serviceTEXT
billed_amtREAL
allowed_amtREAL
paid_amtREAL
statusTEXT
dim_providers_payerdim6 columns
ColumnTypeKey
provider_idINTPK
npiTEXT
specialtyTEXT
network_statusTEXT
tinTEXT
stateTEXT

Hints (3)

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

Hint 1

Two-table join: claims on the fact side, providers on the dimension side, joined on the provider key. The grouping attribute (specialty) lives only on the dimension — claims carry the provider_id, not the specialty.

Hint 2

Aggregate is a row count per specialty. Two pieces still need to fit on top of the GROUP BY: a way to rank the result so the largest counts read first, and a way to keep only the leaders rather than every specialty in the network.

Hint 3

Two output columns named for what they hold. When the brief asks for a 'top N', think about which clause cuts the result set vs. which clause orders it — they're not the same operation and the order they appear in matters.