Skip to main content
All Problems
hard0% acceptance

Cumulative Visit Count per Doctor Over Time

For each doctor, compute a running count of their visits ordered by visit_date. Return doctor full name, visit_date, diagnosis, and cumulative_visit_num (the Nth visit for that doctor). Order by doctor last name, visit_date.

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