Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL for Top-Performing Providers

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is SQL for Top-Performing Providers. Start with the requirements and the two tables on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Write a SQL query to identify top-performing providers based on specific patient outcome metrics at Evernorth Health Services India.

Use the provided tables to evaluate completed encounters during 2025. Include providers with at least two completed encounters and return the top three providers.

Output

  1. One row per provider with provider_id, provider_name, outcome_success_rate, avg_outcome_score, and completed_encounters.
  2. Rank by success rate descending, average score descending, and provider ID ascending as the tie-breaker.

Schema

providers
ColumnTypeDescription
provider_idPKINTUnique provider identifier
provider_nameVARCHAR(100)Provider's full name
specialtyVARCHAR(80)Provider medical specialty
patient_outcomes
ColumnTypeDescription
outcome_idPKINTUnique outcome record identifier
provider_idINTProvider associated with the encounter
encounter_dateDATEDate of the patient encounter
outcome_statusVARCHAR(30)Outcome classification for the encounter
outcome_scoreDECIMAL(5,2)Numerical patient outcome score
Tablesproviderspatient_outcomes
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results