--Semi-structured interpretation: Given all the doctors who have been the attending doctor for patients with bee allergies, return the 5 doctors with the most admissions
--Output SQL Query:
SELECT DISTINCT d.doctor_id, d.first_name, d.last_name, count(*) as num_patients
FROM patients p
JOIN admissions a ON p.patient_id = a.patient_id
JOIN doctors d ON a.attending_doctor_id = d.doctor_id
WHERE allergies LIKE '%bee%'
GROUP BY d.doctor_id, d.first_name, d.last_name
ORDER BY num_patients DESC
LIMIT 5
--Example rows
--Doctor ID | First Name | Last Name | Number of Patients
--------------------------------------------------------------
-- 9102 | Allison | Rogers | 17
-- 5561 | Jack | Bauer | 15
-- 3344 | Chloe | O'Brian | 14