Codex

GAMES

Class Attributes

  • game_id – int, public, the id of the game
  • game_week – int, public, the week of the game
  • game_season – string, public, the season the game is in
  • game_day – string, public, the date of the game
  • game_home_id – int, public, the id of home team
  • game_home_final – int, public, the final score for the home team
  • game_away_id – int, public, the id of the away team
  • game_away_final – int, public, the final score for the away team
  • game_attendance – int, public, the attendance of the game
  • game_preview_link – string, public, the link to the preview of the game
  • game_recap_link – string, public, the link to the recap of the game
  • game_status – string, public, the current status of the game
  • game_current_time – string, public, the current time in the game
  • game_current_period – string, public, the current period/quarter/inning the game is currently in
  • game_current_home_score – string, public, the current score for the home team
  • game_current_away_score – string, public, the current score for the away team

Constructor – Game( $game_id )

  • Takes the id of the game you give it and populates the attributes based on that game’s information.

PLAYERS

Class Attributes

  • player_id** – int, public, the id of the player
  • player_first_name** – string, public, the player’s first name
  • player_last_name** – string, public, the player’s last name
  • player_photo** – string, public, the url to the player’s photo
  • player_position** – string, public, the position the player plays
  • player_home_city** – string, public, the player’s hometown
  • player_home_state** – string, public, the player’s home state
  • player_date_of_birth** – string, public, the player’s date of birth
  • team_id** – int, public, the team id for the team the player currently plays for
  • player_weight** – int, public, the weight of the player
  • player_height** – string, public, the height of the player
  • player_slug** – string, public, the slug for the player for url purposes

Constructor – Player( $player_id )

  • Takes the id or slug of the player you give it and populates the attributes based on that player’s information.

Function – get_age()

  • Public
  • Returns the current age of the player as an integer

Function get_teams_played_for()

  • Public
  • Returns an array of ids of teams that the player has played for

Function get_seasons_played()

  • Public
  • Returns the number of seasons the player has played as an integer

Function get_permalink()

  • Public
  • Returns the URL to the player’s page as a string
  • The returned string does not include the a tag
  • Place the call to this function inside the href attribute of the a tag

Function get_player_photo()

  • Public
  • Returns the img tag with source to the player’s photo for display

TEAMS

Class Attributes

  • team_id** – int, public, the id of the team
  • team_name** – string, public, the team’s name
  • team_location** – string, public, the location of the team
    • This is not necessarily the city the team plays in, but the state or city at the start of the team name (i.e. **Texas** Rangers, **Chicago** Cubs).
    • If the team does not have a formal nickname, like FC Dallas or Real Salt Lake, put the entire team name here as well.
  • team_nickname** – string, public, the team’s nickname
  • team_abbreviation** – string, public, the team’s abbreviation
  • team_city** – string, public, the city the team plays in
  • team_state** – string, public, the state the team plays in
  • team_stadium** – string, public, the stadium the team plays in
  • team_stadium_capacity** – int, public, the capacity of the team’s stadium
  • team_head_coach** – string, public, the current head coach of the team
  • team_logo** – string, public, the url for the team’s logo
  • team_photo** – string, public, the url for the team’s photo
  • team_division** – int, public, the id of the division or conference the team plays in
  • team_primary_color** – string, public, the hexadecimal color value for the team’s primary color
  • team_secondary_color** – string, public, the hexadecimal color value for the team’s secondary color
  • team_slug** – string, public, the slug for the team for url purposes

Constructor – Team( $team_id )

  • Takes the id or slug of the team you give it and populates the attributes based on that team’s information.

Function get_games_played( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the games played from
  • Returns the number of games played for a team for a season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_wins( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the wins from
  • Returns the number of wins for a team for a season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_losses( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the losses from
  • Returns the number of losses for a team for a season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_draws( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the draws from
  • Returns the number of draws for a team for a season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_record( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the record from
  • Returns an array of wins, losses and draws for a team for a season
  • The returned array will have the wins as the first item, losses as the second item and draws as the third item
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_win_percentage( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the win percentage from
  • Returns the winning percentage for a team for a given season as a float value with three digits after the decimal point
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_home_record( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the home record from
  • Returns an array of the home wins, home losses and home draws for a team for a season
  • The returned array will have the wins as the first item, losses as the second item and draws as the third item
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_away_record( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the away record from
  • Returns an array of the away wins, away losses and away draws for a team for a season
  • The returned array will have the wins as the first item, losses as the second item and draws as the third item
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_points_for( $season )

  • Public
  • Accepts a string parameter which is the season you want to grab the points/runs/goals scored from
  • Returns the number of points/runs/goals the team has scored for a season as an integer
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_points_against( $season )

  • Public
  • Accepts a string parameter which is the season you want to grab the points/runs/goals given up from
  • Returns the number of points/runs/goals the team has given up for a season as an integer
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_point_differential( $season )

  • Public
  • Accepts a string parameter which is the season you want to grab the points/runs/goals differential from
  • Returns the number of points/runs/goals differential for a team for a season as an integer
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_division_wins( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the divisional wins from
  • Returns the number of divisional wins for a team for a season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_division_losses( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the divisional losses from
  • Returns the number of divisional losses for a team for a season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_division_draws( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the divisional draws from
  • Returns the number of divisional draws for a team for a season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_division_record( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the divisional record from
  • Returns an array of divisional wins, divisional losses and divisional draws for a team for a season
  • The returned array will have the wins as the first item, losses as the second item and draws as the third item
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_conference_wins( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the conference wins from
  • Returns the number of conference wins for a team for a season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_conference_losses( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the conference losses from
  • Returns the number of conference losses for a team for a season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_conference_draws( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the conference draws from
  • Returns the number of conference draws for a team for a season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_conference_record( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the conference record from
  • Returns an array of conference wins, conference losses and conference draws for a team for a season
  • The returned array will have the wins as the first item, losses as the second item and draws as the third item
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_season( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the schedule from
  • Returns an array of games, which has its own array of information
  • Indexes available for each game: date, week, opponent, location, result, team_score, opponent_score, recap
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_recent_result( $limit = 5, $season )

  • Public
  • Accepts an optional integer parameter that is the number of games to grab
  • Accepts a string parameter which is the season to which to grab the schedule from
  • Returns an array of the most recent games that have been completed, which has its own array of information
  • Indexes available for each game: date, week, opponent, location, result, team_score, opponent_score, recap
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_upcoming_schedule ( $limit = 5, $season )

  • Public
  • Accepts an optional integer parameter that is the number of games to grab
  • Accepts a string parameter which is the season to which to grab the schedule from
  • Returns an array of a number of upcoming games that are scheduled, which has its own array of information
  • Indexes available for each game: date, week, opponent, location, result, recap
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_alltime_wins()

  • Public
  • Returns the number of all-time wins a team has

Function get_alltime_losses()

  • Public
  • Returns the number of all-time losses a team has

Function get_alltime_draws()

  • Public
  • Returns the number of all-time draws a team has

Function get_alltime_record()

  • Public
  • Returns an array of all-time wins, all-time losses and all-time draws for a team for a season
  • The returned array will have the wins as the first item, losses as the second item and draws as the third item

Function get_roster()

  • Public
  • Returns an array of players, which has its own array of information for that player
  • Indexes available for each player: first_name, last_name, player_page, position, age, home_city, home_state, height, weight, photo

Function get_team_photo( $image )

  • Public
  • Accepts a string parameter, either team-logo or team-photo, which indicates which image to return
  • If the parameter is team-logo, the team’s logo will be returned
  • If the parameter is team-photo, the team’s photo will be returned
  • If the parameter is not team-logo or team-photo, null will be returned
  • The returned string includes the img tag with the url in the src attribute

Function get_average_attendance( $season )

  • Public
  • Accepts a string parameter which is the season to which to grab the average attendance from
  • Returns the average attendance for a given season as an float
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_permalink()

  • Public
  • Returns the URL to the team’s page as a string
  • The returned string does not include the a tag
  • Place the call to this function inside the href attribute of the a tag

Function get_division_name()

  • Public
  • Returns the name of the division the team is in as a string

Function border_top_colors( $team_one_id, $team_two_id = null, $div = null )

  • Accepts a required integer parameter, an id of a team
  • Accepts a second, optional integer parameter, an id of another team
  • Accepts an optional string parameter, the id of the div the style affects
  • Returns the border color(s) as either inline styles or embedded style tags for a div based on team ids passed to the function
  • If only one team id is passed to the function, the function will return a style attribute with a 2px solid border-top with the team’s primary color to be added in the div tag
  • If only one team id and the div parameter are passed to the function, the function will return a 2px solid border-top with the team’s primary color in an embedded style tag to be used before the div tag
  • If all three parameters are passed, the function will return an embedded style tag that will make the selected div have a 2px border that’s half the first team’s primary color and half the second team’s primary color

Function division_color( $division_id )

  • Accepts a required integer parameter, an id of a division
  • If the division is listed as a conference, it will return the its color as a hexidecimal value including the # at the beginning
  • If the division is listed as a division, it will return the color of the conference it’s listed under as a hexidecimal value including the # at the beginning

Function team_horizontal_gradient( $team_color )

  • Accepts a required string parameter, the hexidecimal value of a team’s primary or secondary color
  • Returns a string that adds in a background gradient from the color passed to the function to black
  • Place this inside of a style attribute of the div you want to affect

Function show_longform_header()

  • Use if using the longform feature included with the plugin
  • Returns a special header for a longform story
  • Featured image will go full width with the title, author photo and info and date will be in the middle of the image

Function show_team_border_colors()

  • Use only when dealing with a post
  • Returns the border colors in a similar fashion to the border_top_colors based on teams involved in the post
  • If the post is a game preview or recap, the function will return an embedded style tag that will make the selected div have a 2px border that’s half the home team’s primary color and half the away team’s primary color
  • If the post tags one team, the function will return a style attribute with a 2px solid border-top with the team’s primary color to be added in the div tag

Function show_label_head()

  • Use only when dealing with a post
  • If the post is a game preview, the function returns a string as “Away team at Home team”
  • If the post is a game recap, the function returns a string as “Winner score, Loser score”
  • If the post is not a game preview or recap, the function returns the category name as a string

Function show_slider_game_info()

  • Use only when dealing with a post
  • Returns a div section to show game information with the teams’ logos and background gradients
  • Used in the homepage slider in the Sports Bench theme

Function show_game_preview_info()

  • Use only when dealing with a post
  • Returns an aside for a post that is a game preview, displaying the teams, their logos and their records
  • Once the game is finished, the section with display the final score and a link to the recap if there is one
  • Works best if used in a widget area

Function show_game_stats_info()

  • Use only when dealing with a post
  • Returns html that outputs the line score, scoring summary (if applicable), team stats (if applicable), home and away individual stats
  • Works best if used in a sidebar

Function show_game_info( $game_id )

  • Accepts a required integer parameter, the id of the game
  • Returns the attendance, time and date and location (stadium, city, state) for the game
  • Each item is wrapped in an h3 tag

Function team_division_standings( $division_id )

  • Accepts a required integer parameter, the id of the division
  • Grabs the standings for a division with the basic information (games played, record, points (if applicable))
  • Typically, this is best used if you are creating a team page template

Function all_team_standings()

  • Returns the league standings with no divisions or conference
  • Also shows the details (like home and away records, points/runs/goals scored, etc.) chosen in the custom fields for the standings page template

Function conference_division_standings( $division_id )

  • Accepts a required integer parameter, the id of the division
  • Returns the standings for a division or conference
  • Also shows the details (like home and away records, points/runs/goals scored, etc.) chosen in the custom fields for the standings page template

Function widget_standings( $division_id = null )

  • Accepts an optional integer parameter, the id of the division
  • Returns standings, either league, conference or division, with just the basic information (games played, record, points (if applicable))
  • If no division id is given, the league standings will be shown, otherwise, the given division will be shown

Function standings_page_template()

  • Returns the necessary html to display the standings in a page template
  • Makes creating a standings page template for a custom theme easier

Function scoreboard_bar( $class = null )

  • Accepts an optional string parameter, a class to add to the scoreboard bar
  • Returns the scoreboard bar to be placed anywhere on the site
  • Works best if placed in the header for every page

Function scoreboard_page_template()

  • Returns the necessary html to display the scoreboard in a page template
  • Makes creating a scoreboard page template for a custom theme easier

Function get_stats_leaders( $stat, $season )

  • Accepts a required string parameter, a stat to grab
  • Accepts a required string parameter, the season to grab the stats leaders from
  • Returns the top ten leaders for the given stat, as well as a button to load more
  • A list of available stats is located in the get_stat_title function
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_more_stats_leaders( $stat, $season, $offset = 0 )

  • Accepts a required string parameter, a stat to grab
  • Accepts a required string parameter, the season to grab the stats leaders from
  • Accepts an optional integer parameter, the number of players to skip
  • Returns the next ten leaders after the number requested to skip for the given stat
  • A list of available stats is located in the get_stat_title function
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string

Function get_stat_title( $stat )

  • Accepts a required string parameter, a stat to get it’s name
  • Returns the name of a stat based off of its slug
  • A list of available stats is located in this function

Function stats_page_template()

  • Returns the necessary html to display the stats in a page template
  • Makes creating a stats page template for a custom theme easier

Function show_team_player_select()

  • Returns a select menu of teams to pick from
  • Used in the player template to select a player to view
  • Works best when trying to set up a way for users to switch teams easily

Function show_player_info( $player_id )

  • Accepts a required integer parameter, the id of a player
  • Returns the photo, information and stats for a player
  • Used in the player template
  • Makes creating a player page template for a custom theme easier

Function get_teams( $alphabetical = false )

  • Accepts an optional boolean parameter, whether or not the list is alphabetical
  • Returns an array of the teams in the order desired
  • For each team, the team_id is the key in the array and the team name is the value

Function show_roster( $team_id )

  • Accepts a required integer parameter, the id of the team
  • Returns the html to show a team’s roster

Function show_team_schedule( $team_id )

  • Accepts a required integer parameter, the id of the team
  • Returns the html to display a team’s schedule
  • Works best in a sidebar area on a team page template

Function show_team_listing()

  • Returns the html to show the teams with team name, logo, location, head coach and division for each team
  • Works best on the team page template

Function show_team_info( $team_id )

  • Accepts a required integer parameter, the id of the team
  • Returns an aside of basic information for a team as well as the team’s logo
  • Works best in a sidebar on a team page

Function get_linescore( $game_id )

  • Accepts a required integer parameter, the id of a game
  • Returns an array of the line score for a baseball game
  • Used with baseball only

Function get_linescore_display( $game_id )

  • Accepts a required integer parameter, the id of a game
  • Returns the line score for a game
  • Used with baseball, basketball, football, hockey and soccer

Function get_game_stat( $game, $home_away, $stat )

  • Accepts a required integer parameter, the id of a game
  • Accepts a required string parameter, whether it’s a home or away stat
  • Accepts a required string parameter, the team stat to grab
  • Returns a the team stat requested
  • Used with baseball

Function get_score_info( $game_id )

  • Accepts a required integer parameter, the id of a game
  • Returns the scoring summary for a game
  • Used with baseball, football, hockey and soccer

Function get_team_stats_info( $game_id )

  • Accepts a required integer parameter, the id of a game
  • Returns the team stats for a game
  • Used with basketball, football, hockey and soccer

Function get_away_individual_stats( $game_id )

  • Accepts a required integer parameter, the id of a game
  • Returns the individual stats for the away team for a game
  • Used with baseball, basketball, football, hockey and soccer

Function get_home_individual_stats( $game_id )

  • Accepts a required integer parameter, the id of a game
  • Returns the individual stats for the home team for a game
  • Used with baseball, basketball, football, hockey and soccer

Function get_ERA( $earned_runs, $innings_pitched, $innings_per_game )

  • Accepts a required integer parameter, the earned runs given up
  • Accepts a required integer parameter, the innings pitched
  • Accepts a required integer parameter, the number of innings per game
  • Returns the ERA for a pitcher as a float value
  • Used with baseball only

Function get_batting_average( $at_bats, $hits )

  • Accepts a required integer parameter, the at bats taken
  • Accepts a required integer parameter, the hits for a batter
  • Returns the batting average for a batter as a float value
  • Used by baseball only

Function stat_exists( $player, $stat )

  • Accepts a required array parameter, an array of a player’s stats
  • Accepts a required integer parameter, a stat to look for
  • Returns whether or not a player has a specific stat
  • Used by baseball and football

Function get_season_stats( $player )

  • Accepts a required stdClass parameter, an instance of the player class
  • Returns the html for the stats by season for a specific player
  • Used by baseball, basketball, football, hockey, soccer

Function get_pitcher_wins( $player_id, $season )

  • Accepts a required integer parameter, the id of the player
  • Accepts a required string parameter, the season to pull the wins from
  • Returns the number of wins for a pitcher as an integer
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string
  • Used by baseball only

Function get_pitcher_losses( $player_id, $season )

  • Accepts a required integer parameter, the id of the player
  • Accepts a required string parameter, the season to pull the wins from
  • Returns the number of losses for a pitcher as an integer
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string
  • Used by baseball only

Function get_pitcher_record( $player_id, $season )

  • Accepts a required integer parameter, the id of the player
  • Accepts a required string parameter, the season to pull the record from
  • Returns an array of the record for a pitcher for a season
  • Access wins with the ‘wins’ key
  • Access losses with the ‘losses’ key
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string
  • Used by baseball only

Function get_pitcher_saves( $player_id, $season )

  • Accepts a required integer parameter, the id of the player
  • Accepts a required string parameter, the season to pull the saves from
  • Returns the number of saves for a pitcher as an integer
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string
  • Used by baseball only

Function get_players_stats( $team_id, $season )

  • Accepts a required integer parameter, the id of the team
  • Accepts a required string parameter, the season to pull the stats from
  • Returns an array of stats for players from a team for the given season
  • Make sure the season passed to this function is a string, as the SQL will not work without the season being a string
  • Used by baseball, basketball, football, hockey, soccer

Function get_players_stats_table( $player_stats_array )

  • Accepts a required array parameter, the array of player stats
  • Returns the html to show the player stats for a team for a season
  • Used by baseball, basketball, football, hockey, soccer

Function get_points_average( $points, $games )

  • Accepts a required integer parameter, the points scored
  • Accepts a required integer parameter, the games played
  • Returns the points per game for a player as a float value
  • Used by basketball only

Function get_shooting_average( $made, $attempts )

  • Accepts a required integer parameter, the number of made shots
  • Accepts a required integer parameter, the number of attempted shots
  • Returns the shooting average for a player as a float value
  • Used by basketball only

Function get_goals_against_average( $goals_allowed, $games_played )

  • Accepts a required integer parameter, the number of goals allowed
  • Accepts a required integer parameter, the number of games played
  • Returns the goals against average for a player as a float value
  • Used by hockey and soccer

Function get_points( $team_id )

  • Accepts a required integer parameter, the id of the team
  • Returns the number of points the team has accumulated in the current season
  • Used by hockey and soccer

Below is how you can use the wp_8 REST API to access games, game info, game stats, divisions, players and teams from the database and display them on the page.

Divisions

URL: /sportsbench/divisions
Accepted Parameters: division_id, division_name, division_conference, division_conference_id, division_color
Outputs: JSON array of all of the divisions that match the parameters with all of the columns in the divisions table (see “Available Columns” section below)

Games

URL: /sportsbench/games
Accepted Parameters: game_id, game_week, game_season, game_day, game_home_id, game_away_id, game_attendance, game_status
Outputs: JSON array of all of the games that match the parameters with all of the columns in the game table depending on the sport (see “Available Columns” section below)

Game Info

URL: /sportsbench/game_info
Accepted Paramenters: game_info_id, game_id, game_info_inning (if baseball), game_info_quarter (if football), game_info_period (if hockey)
Outputs: JSON array of all of the game info rows that match the parameters with all of the columns in the game_info table depending on the sport (see “Available Columns” section below)

Game Stats

URL: /sportsbench/game_stats
Accepted Parameters: game_stats_player_id, game_id, game_team_id, game_player_id
Outputs: JSON array of all of the game stats rows that match the parameters with all of the columns in the game_stats table depending on the sport (see “Available Columns” section below)

Players

URL: /sportsbench/players
Accepted Parameters: player_id, player_first_name, player_last_name, player_position, player_home_city, player_home_state, player_date_of_birth, team_id, player_weight, player_height, player_slug
Outputs: JSON array of all of the players that match the parameters with all of the columns in the players table (see “Available Columns” section below)

Teams

URL: /sportsbench/teams
Accepted Parameters: team_id, team_name, team_location, team_nickname, team_abbreviation, team_city, team_state, team_stadium, team_stadium_capacity, team_head_coach, team_division, team_name, team_primary_color, team_secondary_color, team_slug
Outputs: JSON array of all of the teams that match the parameters with all of the columns in the teams table (see “Available Columns” section below)

Team Columns

  • team_id, integer
  • team_name, text
  • team_location, text
  • team_nickname, text
  • team_abbreviation
  • team_city, text
  • team_state, text
  • team_stadium, text
  • team_stadium_capacity, integer
  • team_head_coach, text
  • team_division, integer
  • team_primary_color, text
  • team_secondary_color, text
  • team_logo, text
  • team_photo, text
  • team_slug, text

Player Columns

  • player_id, integer
  • player_first_name, text
  • player_last_name, text
  • player_birth_day, text
  • player_photo, text
  • player_position, text
  • player_home_city, text
  • player_home_state, text
  • team_id, integer
  • player_weight, integer
  • player_height, text
  • player_slug, text

Division Columns

  • division_id, integer
  • division_name, text
  • division_conference, text
  • division_conference_id, integer
  • division_color, text

Basic Game Columns

  • game_id, integer
  • game_week, integer
  • game_day, datetime
  • game_season, text
  • game_home_id, integer
  • game_away_id, integer
  • game_home_final, integer
  • game_away_final, integer
  • game_attendance, integer
  • game_status, text
  • game_current_period, text
  • game_current_time, text
  • game_current_home_score, integer
  • game_current_away_score, integer
  • game_recap, text
  • game_preview, text

Basic Game Info Columns

  • game_info_id, integer
  • game_id, integer

Basic Game Player Stats Columns

  • game_stats_player_id, integer
  • game_id, integer
  • game_team_id, integer
  • game_player_id, integer

Baseball Game Columns

  • game_home_doubles, text
  • game_home_triples, text
  • game_home_homeruns, text
  • game_home_hits, integer
  • game_home_errors, integer
  • game_home_lob, integer
  • game_away_doubles, text
  • game_away_triples, text
  • game_away_homeruns, text
  • game_away_hits, integer, integer
  • game_away_errors, integer, integer
  • game_away_lob, integer, integer

Baseball Game Info Columns

  • game_info_inning, text
  • game_info_top_bottom, text
  • game_info_home_score, integer
  • game_info_away_score, integer
  • game_info_runs_scored, integer
  • game_info_score_play, text

Baseball Game Stats Columns

  • game_player_at_bats, integer
  • game_player_hits, integer
  • game_player_runs, integer
  • game_player_rbis, integer
  • game_player_doubles, integer
  • game_player_triples, integer
  • game_player_homeruns, integer
  • game_player_strikeouts, integer
  • game_player_walks, integer
  • game_player_hit_by_pitch, integer
  • game_player_fielders_choice, integer
  • game_player_position, text
  • game_player_innings_pitched, float
  • game_player_pitcher_strikeouts, integer
  • game_player_pitcher_walks, integer
  • game_player_hit_batters, integer
  • game_player_runs_allowed, integer
  • game_player_earned_runs, integer
  • game_player_hits_allowed, integer
  • game_player_homeruns_allowed, integer
  • game_player_pitch_count, integer
  • game_player_decision, text

Basketball Game Columns

  • game_home_first_quarter, integer
  • game_home_second_quarter, integer
  • game_home_third_quarter, integer
  • game_home_fourth_quarter, integer
  • game_home_overtime, integer
  • game_home_fgm, integer
  • game_home_fga, integer
  • game_home_3pm, integer
  • game_home_3pa, integer
  • game_home_ftm, integer
  • game_home_fta, integer
  • game_home_off_rebound, integer
  • game_home_def_rebound, integer
  • game_home_assists, integer
  • game_home_steals, integer
  • game_home_blocks, integer
  • game_home_pip, integer
  • game_home_to, integer
  • game_home_pot, integer
  • game_home_fast_break, integer
  • game_home_fouls, integer
  • game_away_first_quarter, integer
  • game_away_second_quarter, integer
  • game_away_third_quarter, integer
  • game_away_fourth_quarter, integer
  • game_away_overtime, integer
  • game_away_fgm, integer
  • game_away_fga, integer
  • game_away_3pm, integer
  • game_away_3pa, integer
  • game_away_ftm, integer
  • game_away_fta, integer
  • game_away_off_rebound, integer
  • game_away_def_rebound, integer
  • game_away_assists, integer
  • game_away_steals, integer
  • game_away_blocks, integer
  • game_away_pip, integer
  • game_away_to, integer
  • game_away_pot, integer
  • game_away_fast_break, integer
  • game_away_fouls, integer

Basketball Game Info Columns

  • game_info_referees, text
  • game_info_techs, text

Basketball Game Stats Columns

  • game_player_started, text
  • game_player_minutes, integer
  • game_player_fgm, time
  • game_player_fga, integer
  • game_player_3pm, integer
  • game_player_3pa, integer
  • game_player_ftm, integer
  • game_player_fta, integer
  • game_player_points, integer
  • game_player_off_rebound, integer
  • game_player_def_rebound, integer
  • game_player_assists, integer
  • game_player_steals, integer
  • game_player_blocks, integer
  • game_player_to, integer
  • game_player_plus_minus, double

Football Game Columns

  • game_home_first_quarter, integer
  • game_home_second_quarter, integer
  • game_home_third_quarter, integer
  • game_home_fourth_quarter, integer
  • game_home_overtime, integer
  • game_home_total, integer
  • game_home_pass, integer
  • game_home_rush, integer
  • game_home_to, integer
  • game_home_ints, integer
  • game_home_fumbles, integer
  • game_home_fumbles_lost, integer
  • game_home_possession, text
  • game_home_kick_returns, integer
  • game_home_kick_return_yards, integer
  • game_home_penalties, integer
  • game_home_penalty_yards, integer
  • game_home_first_downs, integer
  • game_away_first_quarter, integer
  • game_away_second_quarter, integer
  • game_away_third_quarter, integer
  • game_away_fourth_quarter, integer
  • game_away_overtime, integer
  • game_away_total, integer
  • game_away_pass, integer
  • game_away_rush, integer
  • game_away_to, integer
  • game_away_ints, integer
  • game_away_fumbles, integer
  • game_away_fumbles_lost, integer
  • game_away_possession, text
  • game_away_kick_returns, integer
  • game_away_kick_return_yards, integer
  • game_away_penalties, integer
  • game_away_penalty_yards, integer
  • game_away_first_downs, integer

Football Game Info Columns

  • game_info_quarter, integer
  • game_info_time, integer
  • game_info_scoring_team_id, integer
  • game_info_home_score, integer
  • game_info_away_score, integer
  • game_info_play, text

Football Game Stats Columns

  • game_player_completions, integer
  • game_player_attempts, integer
  • game_player_pass_yards, integer
  • game_player_pass_tds, integer
  • game_player_pass_ints, integer
  • game_player_rushes, integer
  • game_player_rush_yards, integer
  • game_player_rush_tds, integer
  • game_player_rush_fumbles, integer
  • game_player_catches, integer
  • game_player_receiving_yards, integer
  • game_player_receiving_tds, integer
  • game_player_receiving_fumbles, integer
  • game_player_tackles, float
  • game_player_tfl, float
  • game_player_sacks, float
  • game_player_pbu, integer
  • game_player_ints, integer
  • game_player_tds, integer
  • game_player_ff, integer
  • game_player_fr, integer
  • game_player_blocked, integer
  • game_player_yards, integer
  • game_player_fga, integer
  • game_player_fgm, integer
  • game_player_xpa, integer
  • game_player_xpm, integer
  • game_player_touchbacks, integer
  • game_player_returns, integer
  • game_player_return_yards, integer
  • game_player_return_tds, integer
  • game_player_return_fumbles, integer

Hockey Game Columns

  • game_home_first_period, integer
  • game_home_first_sog, integer
  • game_home_second_period, integer
  • game_home_second_sog, integer
  • game_home_third_period, integer
  • game_home_third_sog, integer
  • game_home_overtime, integer
  • game_home_overtime_sog, integer
  • game_home_shootout, integer
  • game_home_power_plays, integer
  • game_home_pp_goals, integer
  • game_home_pen_minutes, integer
  • game_away_first_period, integer
  • game_away_first_sog, integer
  • game_away_second_period, integer
  • game_away_second_sog, integer
  • game_away_third_period, integer
  • game_away_third_sog, integer
  • game_away_overtime, integer
  • game_away_overtime_sog, integer
  • game_away_shootout, integer
  • game_away_power_plays, integer
  • game_away_pp_goals, integer
  • game_away_pen_minutes, integer

Hockey Game Info Columns

  • game_info_event, text
  • game_info_period, integer
  • game_info_time, text
  • player_id, integer
  • game_info_assist_one_id, integer
  • game_info_assist_two_id, integer
  • game_info_penalty, text
  • team_id, integer

Hockey Game Stats Columns

  • game_player_goals, integer
  • game_player_assists, integer
  • game_player_plus_minus, integer
  • game_player_penalties, integer
  • game_player_pen_minutes, integer
  • game_player_hits, integer
  • game_player_shifts, integer
  • game_player_time_on_ice, time
  • game_player_faceoffs, integer
  • game_player_faceoff_wins, integer
  • game_player_shots_faced, integer
  • game_player_saves, integer
  • game_player_goals_allowed, integer

Soccer Game Columns

  • game_home_first_half, integer
  • game_home_second_half, integer
  • game_home_extratime, integer
  • game_home_pks, integer
  • game_home_possession, integer
  • game_home_shots, integer
  • game_home_sog, integer
  • game_home_corners, integer
  • game_home_offsides, integer
  • game_home_fouls, integer
  • game_home_saves, integer
  • game_home_yellow, integer
  • game_home_red, integer
  • game_away_first_half, integer
  • game_away_second_half, integer
  • game_away_extratime, integer
  • game_away_pks, integer
  • game_away_possession, integer
  • game_away_shots, integer
  • game_away_sog, integer
  • game_away_corners, integer
  • game_away_offsides, integer
  • game_away_fouls, integer
  • game_away_saves, integer
  • game_away_yellow, integer
  • game_away_red, integer

Soccer Game Info Columns

  • team_id, integer
  • game_info_home_score, integer
  • game_info_away_score, integer
  • game_info_event, text
  • game_info_time, integer
  • player_id, integer
  • game_player_name, text
  • game_info_assists, text

Soccer Game Stats Columns

  • game_player_minutes, integer
  • game_player_goals, integer
  • game_player_assists, integer
  • game_player_shots, integer
  • game_player_sog, integer
  • game_player_fouls, integer
  • game_player_fouls_suffered, integer
  • game_player_shots_faced, integer
  • game_player_shots_saved, integer
  • game_player_goals_allowed, integer