Query Library

Casey Trauer submitted this query on: October 02, 2012 9:57pm EDT
TITLE Find inactive players before the game
SPORTS American Football
QUERY SELECT dn_team.full_name, t.team_key, dn_player.full_name, p.person_key, e.event_key
FROM events as e
JOIN person_event_metadata pem ON pem.event_id = e.id
JOIN persons p ON pem.person_id = p.id
JOIN teams t ON pem.team_id = t.id
JOIN display_names as dn_player ON p.id = dn_player.entity_id AND dn_player.entity_type = 'persons'
JOIN display_names as dn_team ON t.id = dn_team.entity_id AND dn_team.entity_type = 'teams'
WHERE pem.status='scratched'
AND e.event_key = 'l.nfl.com-2012-e.4059';
DESCRIPTION The Sports Network sends a list of inactive players about an hour before game time. You can query for those players this way.
DBs TESTED MySQL
ADDITIONAL NOTES