SELECT team_rankings.*, activity_programs.name FROM team_rankings, activity_programs WHERE team IN (SELECT id FROM teams WHERE activity_program IN (SELECT id FROM activity_programs WHERE school_year = 2014 AND activity = 'VBL' AND division = '6A')) AND activity_programs.id = (SELECT activity_program FROM teams WHERE teams.id = team_rankings.team)

SELECT * FROM `contests` WHERE (home_Team = 5878 or away_team = 5878) AND activity = 'VBL' AND school_year = 2014


SELECT * FROM `contest_teams_scores` WHERE team = 8578 AND contest NOT IN (SELECT id FROM `contests` WHERE (home_Team = 8578 or away_team = 8578) AND activity = 'VBL' AND school_year = 2014)

/* 2015 ADM */
SELECT schools.short_name, mascots.name, schools.id FROM schools, mascots WHERE schools.mascot = mascots.id AND schools.id IN (SELECT school FROM school_demographics WHERE school_year = 2014 AND is_associate_member = 0) ORDER BY schools.short_name

/* Forfeited contests not done by OSAA */
SELECT * FROM `contests` WHERE activity IN ('BBX', 'GBX') AND school_year = 2014 AND (home_team_score IS NOT NULL AND away_team_score IS NOT NULL) AND (home_team_score = 0 OR away_team_score = 0) AND level = 'V' AND is_forfeit = 0 AND event IN (SELECT id FROM events WHERE event_status = 'DONE')