Player-Level Data

theory

In a game-level data table each row contains a team’s performance in a game. An SDQL game-level query consists of stepping through each half game in the database from start to finish. Examples of team parameters for the NBA include: site, points, and assists. The full list of parameters is given on the SportsDatabase.com NBA SDQL Query Page under Game Parameters.

In a player-level data table each row contains a player’s performance in a game. An SDQL player-level query consists of stepping through each player for every game in the database from start to finish. Examples of NFL player-level data tables include: rushing, passing, receiving. The NBA has a single player-level table called player. Examples of NBA player parameters include: minutes, points, three pointers made. The full list of NBA player parameters is given on the SportsDatabase.com NBA SDQL Player Query Page under Player Parameters.

Player results can be accessed from a game-level query and team results can be accessed from a player-level query. Player parameters can have the same name as Game parameters. For example, in the NBA both teams and players have a parameter called points. Sibling player data tables cannot share parameter names. For example, MLB batters have a parameter called strike outs. This requires the pitcher’s data table to use the more verbose strike outs thrown.

team:player:prefix:parameter

In a game-level query, the full reference to a player parameter is: team:player:prefix:parameter.

To see how the Cavaliers have done when LeBron James scored more than 30,40, and 50 points in the previous game against the current opponent, use the SDQL:
Cavaliers:LeBron James:P:points>30,40,50
If you want to take the query over LeBron James’ career, just leave off the Team: part.
LeBron James:P:points > 30,40,50
You can save some typing by minimally specifing the Player: part. If you know that there is only one LeBron, use the SDQL:
LeBron:P:points > 30,40,50
If you underspecify a player name, the query raises an UnknownPlayer error and provides a list of possible matches.
LB:P:points > 30,40,50

The MLB database provides for the use of Starter and Closer for Player.

To see the distribution of starter’s strike outs in the 2017 season, use the game-level SDQL:
Starter:strike outs thrown and season=2017
To isolate MLB games in which the closer had more innings pitched than the starter, use the game-level SDQL:
Starter:innings pitched < Closer:innings pitched

sum: max: min: list:

The Python built-in methods sum, max, min and list can be used in the position of the player’s name.

To isolate NFL games where a least one player had more than 200 rushing yards, use the SDQL:
max:rushing yards>200
To see how NFL teams have done when three players racked up more than 100 receiving yards, use the SDQL:
len(filter(lambda x:x>100,list:receiving yards))=3

When a player-level-only parameter is referenced without a player reference, the appropriate Python method is used.

The MLB player-level parameter ground balls is interpreted at the team-level as sum:ground balls. The NFL player-level parameter longest reception is interpreted at the team-level as max:longest reception.

player-level query

Player-level queries are valuable for researching player performance.

To see the date, points and minutes for Damian Lillard in 2016, use the SDQL.
date, points, minutes @ name=Damian Lillard and season=2016

Player-level queries can access team-level parameters by reference.

To see the date, name and rushing yards for Bears players in 2017 when they are the underdog, use the player-level SDQL:
date, name, rushing yards @ team=Bears and season=2017 and D

Game-level parameters date, team, season and line (implied in the Short Cuts D) are used along with the player-level parameters name and rushing yards.

To reference a team-level parameter when there is a player-level parameter with the same name, use the indicator Team:
date, points, Team:points, minutes @ name=Damian Lillard and season=2016

Just as with game-level queries, player-level queries provide default outputs when request parameters are not specified. For singleton queries, summary stats and a game listing are provided by default.

To see summary stats and game listing for all triple-doubles in 2016 use the player-level SDQL:
assists>9 and points>9 and rebounds>9 and season=2016

For player-level grouping queries, summary stats for each query group are provided by default.

To see summary stats for players after they scored more than 20, 30, 40 and 50 points, use the player-level SDQL:
20,30,40,50 < p:points
To see summary stats for players after they scored more than 20, 30, 40 and 50 percent of their team’s points, use the player-level SDQL:
20,30,40,50 < 100 * p:points / Team:p:points