For each department, find the most frequently occurring diagnosis. Return the department name, the top diagnosis, and its count. In case of ties, any one is acceptable.
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