I was tasked to produce a list of unique email addresses of CTL event attendees for events held Spring 2013.
Short answer:
select distinct first_name,last_name,email from users left join enrollments on enrollments.user_id=users.id left join events on enrollments.event_id=events.id left join event_types on event_types.event_id=events.id left join types on types.id=event_types.`type_id` left join event_sponsors on event_sponsors.event_id=events.id left join sponsors on sponsors.id=event_sponsors.`sponsor_id` where events.start_day>’2012-12-31′ and is_facilitating=0 and (sponsors.sponsor IS NULL or sponsors.sponsor != “Writing in the Disciplines”) order by last_name
Long answer:
https://www.uvm.edu/~waw/php/recent_event_attendees.php
Notes:
- No need to tag events: just need to filter start day where events.start_day>’2012-12-31′
- Some small effort was made to filter by sponsor (CTL, WID, etc.); however, sponsor was not specified for many events
- No effort was made to sponsor by event type (workshop, book group, etc.) as event type was not specified for many events