Chapter 4 · Aggregations
66. Visit Count by Month and Year
Medium20 XPHealthcare
Operations wants a monthly breakdown of visits. Extract the year and month from visit_date and count visits per month. Return visit_year, visit_month, and visit_count. Order by year then month.
Tables
- PKidINT
- FKpatient_id→ patients.idINT
- FKdoctor_id→ doctors.idINT
- visit_dateTEXT
- diagnosisTEXT
- notesTEXT
- follow_up_dateTEXT
- statusTEXT
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.