Query Library

Casey Trauer submitted this query on: February 11, 2011 5:30pm EST
TITLE Basketball team offensive stats for event
SPORTS Basketball
QUERY SELECT dn_team.first_name, dn_team.last_name, t.team_key, off.points_scored_total, off.field_goals_made FG, off.field_goals_attempted FGA, off.three_pointers_made 3G, off.three_pointers_attempted 3GA, free_throws_made FT, free_throws_attempted FTA, off.points_scored_total PTS, off.assists_total AST, off.turnovers_total 'TO'

FROM events AS e
JOIN stats AS s ON (s.stat_coverage_type = 'events' AND s.stat_coverage_id=e.id AND s.stat_holder_type = 'teams')
JOIN basketball_offensive_stats off ON (s.stat_repository_id = off.id AND s.stat_repository_type = 'basketball_offensive_stats')
JOIN display_names dn_team ON (dn_team.entity_id = s.stat_holder_id AND dn_team.entity_type = 'teams')
JOIN teams t ON s.stat_holder_id = t.id
JOIN publishers pub ON e.publisher_id = pub.id

WHERE pub.publisher_key = 'sportsnetwork.com'
AND e.event_key = 'l.nba.com-2010-e.13857'
AND s.context = 'event';
DESCRIPTION Returns offensive stats for each NBA team.
DBs TESTED MySQL
ADDITIONAL NOTES
Comments
on September 15, 2011 8:00pm EDT RODNEY CEPHAS wrote:
Metadata: DB Tested: MySQL
Query:
n/a

"test"

on September 15, 2011 8:01pm EDT RODNEY CEPHAS wrote:
Metadata: DB Tested: MySQL
Query:
SELECT dn_team.first_name, dn_team.last_name, t.team_key, off.points_scored_total, off.field_goals_made FG, off.field_goals_attempted FGA, off.three_pointers_made 3G, off.three_pointers_attempted 3GA, free_throws_made FT, free_throws_attempted FTA, off.points_scored_total PTS, off.assists_total AST, off.turnovers_total 'TO'

FROM events AS e
JOIN stats AS s ON (s.stat_coverage_type = 'events' AND s.stat_coverage_id=e.id AND s.stat_holder_type = 'teams')
JOIN basketball_offensive_stats off ON (s.stat_repository_id = off.id AND s.stat_repository_type = 'basketball_offensive_stats')
JOIN display_names dn_team ON (dn_team.entity_id = s.stat_holder_id AND dn_team.entity_type = 'teams')
JOIN teams t ON s.stat_holder_id = t.id
JOIN publishers pub ON e.publisher_id = pub.id

WHERE pub.publisher_key = 'sportsnetwork.com'
AND e.event_key = 'l.nba.com-2010-e.13857'
AND s.context = 'event';

"test"