Skip to main content
All Problems
medium0% acceptance

Number of Unique Patients per Doctor

Hospital management wants to understand each doctor's patient load. For each doctor, return their full name (first_name || ' ' || last_name) as doctor_name, specialty, and the number of distinct patients they have seen as patient_count. Only include doctors who have seen at least one patient. Order by patient_count descending.

Schema

🔑idINT
first_nameTEXT
last_nameTEXT
specialtyTEXT
🔗department_idINT
emailTEXT
phoneTEXT
hire_dateTEXT
salaryREAL
postgresql

Run your query to see results

Press Ctrl + Enter to execute