runtime
10 / 139

task Missing relationships / anti-joins · easy

Providers with no encounters

Find every provider who has no encounters. Return provider_id, full_name and specialty.

what to return

Columns
provider_idfull_namespecialty in this order
Rows
29 rows · any order
Skill
Find rows with no related rows. Refresher: Ask whether a row exists →

expected result

expected result29 rows · any order
provider_idfull_namespecialty
115Mark AhmedOrthopedics
137Lucia RobinsonCardiology
178Nia AbbottOrthopedics

first 3 of 29 rows

data you can query

providers6 columns · 460 rows
provider_idnumber · unique idfull_nametextspecialtytextclinic_nametextcitytextstatetext
1Amara MehtaFamily MedicineProvidence Family PracticeProvidenceRI
2Alice HillFamily MedicineNimbus Health CenterAtlantaGA
3Ryan ShahNephrologyCleveland Community ClinicClevelandOH
4Sofia LeeFamily MedicineAlbuquerque Community ClinicAlbuquerqueNM
5Joseph HowardFamily MedicinePrism Health CenterNew YorkNY
6Anika ScottPediatricsSolar Health CenterIndianapolisIN
7Carlos BakerFamily MedicineSolar Health CenterSan JoseCA
8Leah BellPediatricsPortland Community ClinicPortlandME
9Jordan KaurFamily MedicineChicago Medical GroupChicagoIL
10Nia CastilloFamily MedicineSpruce Health CenterChicagoIL
provider_idnumber · unique id
1
full_nametext
Amara Mehta
specialtytext
Family Medicine
clinic_nametext
Providence Family Practice
citytext
Providence
statetext
RI
provider_idnumber · unique id
2
full_nametext
Alice Hill
specialtytext
Family Medicine
clinic_nametext
Nimbus Health Center
citytext
Atlanta
statetext
GA
provider_idnumber · unique id
3
full_nametext
Ryan Shah
specialtytext
Nephrology
clinic_nametext
Cleveland Community Clinic
citytext
Cleveland
statetext
OH
provider_idnumber · unique id
4
full_nametext
Sofia Lee
specialtytext
Family Medicine
clinic_nametext
Albuquerque Community Clinic
citytext
Albuquerque
statetext
NM
provider_idnumber · unique id
5
full_nametext
Joseph Howard
specialtytext
Family Medicine
clinic_nametext
Prism Health Center
citytext
New York
statetext
NY
provider_idnumber · unique id
6
full_nametext
Anika Scott
specialtytext
Pediatrics
clinic_nametext
Solar Health Center
citytext
Indianapolis
statetext
IN
provider_idnumber · unique id
7
full_nametext
Carlos Baker
specialtytext
Family Medicine
clinic_nametext
Solar Health Center
citytext
San Jose
statetext
CA
provider_idnumber · unique id
8
full_nametext
Leah Bell
specialtytext
Pediatrics
clinic_nametext
Portland Community Clinic
citytext
Portland
statetext
ME
provider_idnumber · unique id
9
full_nametext
Jordan Kaur
specialtytext
Family Medicine
clinic_nametext
Chicago Medical Group
citytext
Chicago
statetext
IL
provider_idnumber · unique id
10
full_nametext
Nia Castillo
specialtytext
Family Medicine
clinic_nametext
Spruce Health Center
citytext
Chicago
statetext
IL

first 10 of 460 rows · your queries use all of them

encounters9 columns · 20,447 rows
encounter_idnumber · unique idpatient_idnumber · links to patientsprovider_idnumber · links to providersencounter_classtextstart_atdate & timeend_atdate & timereason_codetexttotal_costdecimalpayer_paiddecimal
114ambulatory2022-08-07 13:00:002022-08-07 13:24:45T78.40XA175.6159.38
214telehealth2022-10-12 11:15:002022-10-12 11:59:48E11.9110.0295.53
3174telehealth2023-05-12 11:30:002023-05-12 12:13:27E11.983.6874.77
41349ambulatory2023-12-17 08:15:002023-12-17 08:39:33E11.9198.23187.3
514telehealth2024-05-09 16:45:002024-05-09 17:29:01E66.9115.0898.4
614ambulatory2024-09-07 13:00:002024-09-07 13:27:30E66.9153.61142.99
714ambulatory2025-03-21 14:45:002025-03-21 15:06:04E66.9205.8186.35
81347urgent_care2025-04-13 19:00:002025-04-13 19:56:05U07.1271.26249.02
92309ambulatory2022-09-03 12:30:002022-09-03 12:53:18K21.9207.99159.16
102309ambulatory2022-12-17 14:30:002022-12-17 14:56:24J02.9165.38129.81
encounter_idnumber · unique id
1
patient_idnumber · links to patients
1
provider_idnumber · links to providers
4
encounter_classtext
ambulatory
start_atdate & time
2022-08-07 13:00:00
end_atdate & time
2022-08-07 13:24:45
reason_codetext
T78.40XA
total_costdecimal
175.6
payer_paiddecimal
159.38
encounter_idnumber · unique id
2
patient_idnumber · links to patients
1
provider_idnumber · links to providers
4
encounter_classtext
telehealth
start_atdate & time
2022-10-12 11:15:00
end_atdate & time
2022-10-12 11:59:48
reason_codetext
E11.9
total_costdecimal
110.02
payer_paiddecimal
95.53
encounter_idnumber · unique id
3
patient_idnumber · links to patients
1
provider_idnumber · links to providers
74
encounter_classtext
telehealth
start_atdate & time
2023-05-12 11:30:00
end_atdate & time
2023-05-12 12:13:27
reason_codetext
E11.9
total_costdecimal
83.68
payer_paiddecimal
74.77
encounter_idnumber · unique id
4
patient_idnumber · links to patients
1
provider_idnumber · links to providers
349
encounter_classtext
ambulatory
start_atdate & time
2023-12-17 08:15:00
end_atdate & time
2023-12-17 08:39:33
reason_codetext
E11.9
total_costdecimal
198.23
payer_paiddecimal
187.3
encounter_idnumber · unique id
5
patient_idnumber · links to patients
1
provider_idnumber · links to providers
4
encounter_classtext
telehealth
start_atdate & time
2024-05-09 16:45:00
end_atdate & time
2024-05-09 17:29:01
reason_codetext
E66.9
total_costdecimal
115.08
payer_paiddecimal
98.4
encounter_idnumber · unique id
6
patient_idnumber · links to patients
1
provider_idnumber · links to providers
4
encounter_classtext
ambulatory
start_atdate & time
2024-09-07 13:00:00
end_atdate & time
2024-09-07 13:27:30
reason_codetext
E66.9
total_costdecimal
153.61
payer_paiddecimal
142.99
encounter_idnumber · unique id
7
patient_idnumber · links to patients
1
provider_idnumber · links to providers
4
encounter_classtext
ambulatory
start_atdate & time
2025-03-21 14:45:00
end_atdate & time
2025-03-21 15:06:04
reason_codetext
E66.9
total_costdecimal
205.8
payer_paiddecimal
186.35
encounter_idnumber · unique id
8
patient_idnumber · links to patients
1
provider_idnumber · links to providers
347
encounter_classtext
urgent_care
start_atdate & time
2025-04-13 19:00:00
end_atdate & time
2025-04-13 19:56:05
reason_codetext
U07.1
total_costdecimal
271.26
payer_paiddecimal
249.02
encounter_idnumber · unique id
9
patient_idnumber · links to patients
2
provider_idnumber · links to providers
309
encounter_classtext
ambulatory
start_atdate & time
2022-09-03 12:30:00
end_atdate & time
2022-09-03 12:53:18
reason_codetext
K21.9
total_costdecimal
207.99
payer_paiddecimal
159.16
encounter_idnumber · unique id
10
patient_idnumber · links to patients
2
provider_idnumber · links to providers
309
encounter_classtext
ambulatory
start_atdate & time
2022-12-17 14:30:00
end_atdate & time
2022-12-17 14:56:24
reason_codetext
J02.9
total_costdecimal
165.38
payer_paiddecimal
129.81

first 10 of 20,447 rows · your queries use all of them

solution.sql
 
Output

Hints and the answer are always available. Using them counts the question as solved with help.

Providers with no encounters — SQL practice · Runtime