new erd

Tables (9)

game

  • game_id — INT — Primary key — NOT NULL
  • season_id — INT — Foreign key → season.season_id — NOT NULL
  • game_date — DATE — NOT NULL
  • home_team_id — INT
  • away_team_id — INT
  • home_team_score — INT
  • away_team_score — INT

head_to_head

  • match_id — INT — Primary key — NOT NULL
  • season_id (season_id2) — INT — Foreign key → season.season_id — NOT NULL
  • team1_id — INT — NOT NULL
  • team2_id — INT — NOT NULL
  • team1_wins — INT — NOT NULL
  • team2_wins — INT — NOT NULL

player

  • player_id — INT — Primary key — NOT NULL
  • team_id — INT — Foreign key → team.team_id — NOT NULL
  • player_name — VARCHAR(255) — NOT NULL
  • position — VARCHAR(50)
  • height — INT
  • weight — INT
  • birthdate — DATE
  • school — VARCHAR(255)

player_rank

  • rank_id — INT — Primary key — NOT NULL
  • season_id — INT — Foreign key → season.season_id — NOT NULL
  • player_id — INT — Foreign key → player.player_id — NOT NULL
  • team_id — INT — Foreign key → player.team_id — NOT NULL
  • player_rank — INT — NOT NULL
  • category — VARCHAR(50) — NOT NULL
  • value — DECIMAL(5, 1) — NOT NULL

season

  • season_id — INT — Primary key — NOT NULL
  • season_year — VARCHAR(9) — NOT NULL

season_stats

  • season_stats_id — INT — Primary key — NOT NULL
  • player_id — INT — Foreign key → player.player_id — NOT NULL
  • team_id — INT — Foreign key → player.team_id — NOT NULL
  • season_id — INT — Foreign key → season.season_id — NOT NULL
  • games_played — INT
  • minutes_per_game — TIME
  • points_per_game — DECIMAL(4, 1)
  • field_goals_made_per_game — DECIMAL(4, 1)
  • three_pointers_made_per_game — DECIMAL(4, 1)
  • free_throws_made_per_game — DECIMAL(4, 1)
  • offensive_rebounds_per_game — DECIMAL(4, 1)
  • defensive_rebounds_per_game — DECIMAL(4, 1)
  • total_rebounds_per_game — DECIMAL(4, 1)
  • assists_per_game — DECIMAL(4, 1)
  • steals_per_game — DECIMAL(4, 1)
  • blocks_per_game — DECIMAL(4, 1)
  • turnovers_per_game — DECIMAL(4, 1)
  • personal_fouls_per_game — DECIMAL(4, 1)

statistics

  • stats_id — INT — Primary key — NOT NULL
  • game_id — INT — Foreign key → game.game_id — NOT NULL
  • season_id — INT — Foreign key → game.season_id — NOT NULL
  • player_id — INT — Foreign key → player.player_id — NOT NULL
  • team_id — INT — Foreign key → player.team_id — NOT NULL
  • points — INT
  • rebounds — INT
  • assists — INT
  • blocks — INT
  • steals — INT
  • turnovers — INT
  • field_goals_made — INT
  • field_goals_attempted — INT
  • three_pointers_made — INT
  • three_pointers_attempted — INT
  • free_throws_made — INT
  • free_throws_attempted — INT
  • offensive_rebounds — INT
  • defensive_rebounds — INT
  • minutes_played — TIME

team

  • team_id — INT — Primary key — NOT NULL
  • team_name — VARCHAR(255) — NOT NULL
  • team_stadium — VARCHAR(255)

team_rank

  • rank_id — INT — Primary key — NOT NULL
  • team_id — INT — Foreign key → team.team_id — NOT NULL
  • season_id — INT — Foreign key → season.season_id — NOT NULL
  • team_rank — INT — NOT NULL
  • wins — INT — NOT NULL
  • losses — INT — NOT NULL
  • win_rate — DECIMAL(5, 3) — NOT NULL
  • games_behind — DECIMAL(5, 2)
  • last_5_games — VARCHAR(10)
  • streak — VARCHAR(10)
  • home_record — VARCHAR(10)
  • away_record — VARCHAR(10)