Emails for recent event attendees

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:

  1. No need to tag events: just need to filter start day where events.start_day>’2012-12-31′
  2. Some small effort was made to filter by sponsor (CTL, WID, etc.); however, sponsor was not specified for many events
  3. No effort was made to sponsor by event type (workshop, book group, etc.) as event type was not specified for many events

About Wesley Wright

Born on a mountain top near New York City, Craziest state in the land of the pretty. Raised in the woods so's he knew every tree, Killed him a bear when he was only three.
This entry was posted in Wes and tagged , . Bookmark the permalink.