Doctor With the Most Distinct Patients
Medium
Healthcare Queries
Return the doctor_id with the largest number of distinct patients seen, and that count.
Table schema
Appointments(id INT PRIMARY KEY, doctor_id INT, patient_id INT)Sample data
id | doctor_id | patient_id
1 | 1 | 10
2 | 1 | 11
3 | 1 | 10
4 | 2 | 12
5 | 2 | 13
6 | 2 | 14
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.