An events platform organizes workshops for internal teams and the public. It stores every workshop separately from the attendee check-ins recorded at the door.
Table: workshops
+---------------+--------------+
| Column Name | Type |
+---------------+--------------+
| workshop_id | integer |
| room_id | integer |
| audience_type | varchar(255) |
| workshop_date | date |
+---------------+--------------+
+---------------+--------------+
| Column Name | Type |
+---------------+--------------+
| workshop_id | integer |
| room_id | integer |
| audience_type | varchar(255) |
| workshop_date | date |
+---------------+--------------+
workshop_id is the primary key. audience_type may contain internal, public, or another value.
checkin_id is the primary key. workshop_id references workshops.workshop_id. Each row represents one attendee check-in.
Consider workshops dated from 2026-09-07 through 2026-09-13, inclusive, whose audience_type is either internal or public.
First count the check-ins for each qualifying workshop. A workshop with no matching rows in workshop_checkins must have a count of 0. Then calculate the average check-in count per workshop for each audience_type.
Return audience_type and avg_attendees, rounded to 2 decimal places. Order the results by audience_type ascending. Do not return an audience type that has no qualifying workshops.
The internal workshops have 2, 1, and 3 check-ins, for an average of 2.00. The public workshops have 4 and 0 check-ins, also averaging 2.00. Workshop 5 remains in the calculation because the left join preserves workshops without check-ins.