An online tutoring platform tracks every completed lesson. Its community program highlights one active part-time tutor per month while excluding tutors whose workload exceeds the program's monthly limit.
session_id is the primary key. Each row represents one completed tutoring session.
For each calendar month, count the sessions completed by every tutor. A tutor is high-volume in a month when they completed more than 30 sessions during that month. Exclude high-volume tutors from that month's selection; a tutor with exactly 30 sessions remains eligible.
Among the eligible tutors in each month, return the tutor with the highest session count. If multiple eligible tutors have the same count, choose the tutor with the smaller tutor_id.
If every tutor in a month is high-volume, do not return a row for that month.
Return month in YYYY-MM format, tutor_id, and session_count. Return at most one row per month and order the results by month ascending.
Example
Input:
The table below is abbreviated; each range represents individual session rows.