How to create a database of sports statistics for several sports?

I am trying to create a database to store player statistics for various sports.

In the database you will have a bunch of players. Each player belongs to one team, and each team plays in one sport. Here are the tables that I have for this part:

Player (Player_ID, Team_ID, FirstName, LastName)

Team (Team_ID, Sport_ID, TeamName)

Sport (Sport_ID, SportName)

Now I want to save player statistics. I encounter a problem when different players play different sports and therefore must keep different types of statistics for each sport. If I kept hockey players and baseball players, for example:

  • for hockey players I want to keep goals and help

  • for baseball players I want to keep hits, home runs and RBIs.

Is there a way to do something like this using a single database? Did I even start right?

+6
source share
8 answers

The right way is to make several tables, one for each sport. Probably,

Player (Player_ID, FirstName, LastName)
Team (Team_ID, Sport_ID, TeamName)
TeamList (Team_ID, Player_ID)
Sports (Sport_ID, SportName)
HockeyStats (Player_ID, Team_ID, Year, Goals, GamesPlayed, Assists)
BaseBallStats (Player_ID, Team_ID, Years, BoringSport)

It also solves the trading situation with which the team received points, as well as several sports.

+4
source

sportsdb, rdbms , XML Team. , (, ) . ,

+5

.

. , (Game_ID, Sport_ID, Team1_ID, Team2_ID), (Date_Played, Win_Lose_Tie ..)

. TBL_Baseball_Stats (Stat_ID, Game_ID, Player_ID, Hits, HR, ..)

. TBL_Hockey_Stats (Stat_ID, Game_ID, Player_ID, , ..)

, , ..

+2

- -, , . , . , (, , ), ( , ..).

+2

, , - , . , .

, , .

( ), , ​​. :

  • .
  • .
  • (, ..).

, .

+1

, (: MONGODB), .

+1

, , ( ), .

- , AVG./Games/Runs/Hits/AB/SB/2B/3B. , W/ERA/WHIP/SO.

0

Thanks for the best answers, and I tried 2 of them that they work with to watch sports broadcasts on the site https://ghdsports.fun/ghd-sports-apk/

0
source

All Articles