Added SQL query for events page