Created an initial query with two joins for the teams SELECT. Tested through SQL, now transferring to Drupal 7 syntax.