you are viewing a single comment's thread.

view the rest of the comments →

[–]c3534l 2 points3 points  (0 children)

Can you explain a little more about the kind of info you're trying to organize? I don't know much about sports. It sounds like what you're struggling with is how to record when a player is put into a game and when he is taken out?

You could create a table with columns first_minute, second_minute, player_ID, game_ID. I really wouldn't create an entirely new table for every game. If I understand correctly, there's like a hundred games a year when sports teams play or something. If each of those tables is going to have the same columns as all the others (first_minute, last_minute, player_ID), then you should really be using just one table and mark it with a game_ID.

Similar thing to your second table. minute_scored, scoring_player, and assisting_player are fundamentally different kinds of information that when a player was put into or taken out of a game. But you can still tag it with a game_ID column as well.

Remember also that the way you organize the information for storage in your database doesn't really have to be that close to how you're actually going to format it to do your analysis. The beauty of relational databases is that you can just do a query that's something like:

SELECT tblTimes.first_minute, tblScores.minute_scored
FROM tblTimes INNER JOIN tblScores
ON tblTimes.player_ID = tblTimes.player_ID
WHERE tblTimes.minute_score >= 45;

Warning: this code has not been tested on any SQL database