Chapter 4 · Aggregations
68. Patients Who Saw Multiple Doctors
Medium20 XPHealthcare
Care coordination wants to identify patients who have been seen by more than one doctor. Return patient first_name, last_name, and doctor_count (distinct doctors). Only include patients with doctor_count > 1. Order by doctor_count descending.
Tables
- PKidINT
- first_nameTEXT
- last_nameTEXT
- date_of_birthTEXT
- genderTEXT
- emailTEXT
- phoneTEXT
- blood_typeTEXT
- cityTEXT
- stateTEXT
- FKinsurance_id→ insurance.idINT
- created_atTIMESTAMP
- PKidINT
- FKpatient_id→ patients.idINT
- FKdoctor_id→ doctors.idINT
- visit_dateTEXT
- diagnosisTEXT
- notesTEXT
- follow_up_dateTEXT
- statusTEXT
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.