1

I am trying to design a database as a personal/passion development project to track current and historical football game information. I am having trouble with table designs that will allow me to store data that might change over a period of time. For instance, stadium capacity may grow or shrink based on a renovation of the stadium.

In this simple diagram, I have three tables:

Database Design

But with this design, I will only store the current capacity of the stadium so if Stadium A increases capacity by 5,000 in 2018 - all events before would reflect the current capacity and not the capacity when the event occurred.

My initial thought it that I would need an additional table - maybe StadiumCapacity - that would store the stadium ID, a capacity number, and the years that stadium held that capacity and possible a MostRecent column.

Does anyone have experience with designing a database for sports related information and would this be the most efficient way of tracking this information?

1

Three options:

Option One

Create a history table storing all data that can change about the stadium. This could also include its name, though its location is probably set. Lets call this "StadiumHistory". Your Schedule table would then use this as its FK. The StadiumHistory table would have a FK to the Stadium table which uniquely identifies the stadium and its location.

Option Two

Ask yourself "what is my eventual goal?". The answer is probably "to create a system which can be queried really quickly, where calculations including aggregation functions of teams/goals/etc can be performed very quickly to enable me to identify likely results or predict future outcomes based on a variety of factors, or to examine trends etc from the past".

If this is your eventual goal, you may want to keep your 3NF database above plus have it regularly export to another database, one which has dimension normalization - a data warehouse. Your stadium then becomes a Dimension table, probably expanded to "Location" with your results a Fact table. This Dimension table would contain values (which would often repeat) for all of the fields you have specified in Stadium. In fact, you could expand the "Location" table then to include weather information for the day, pitch condition, crowd attendance etc.

This approach has many advantages long term, but requires a new database (development) and an appropriate ETL process to load it. My experience tells me, you will eventually be building this if your database records historical information and you want to begin aggregating information for trend analysis. If you find yourself writing history tables for everything, you will find the interfaces for this difficult to maintain in your current database.

Option Three

Forget about anything that changes. Is it really important that you record the capacity on any day? If not, don't worry about the history of recording stadium capacity. Your database then only contains the most up to date stadium information.

This is the simplest option - it means you don't have to change your database design.

| improve this answer | |
  • Recommendation to OP: If you are just starting, go for option 1. The day that you need to do real fast aggregations, you'll go for option 2. Give yourself time for that; maybe that day, computers are fast enough not to need this kind of optimizations. – joanolo Jan 19 '17 at 21:54
  • Thanks for the advice @joanolo. Option 1 looks like my best bet - I'm not at the stage to be trying to design a data warehouse yet and I do want to track capacity - to compare it to attendance. And this will also help me track conference affiliation as universities have changed theirs over the past few years. – MISNole Jan 20 '17 at 15:10
  • And for the answer @blobbles – MISNole Jan 20 '17 at 15:10
1

An answer to a similar question is here which discusses Version Normal Form.

I wouldn't expect a stadium to change very often, but it would be a good idea to track those changes, especially for reporting purposes. Something that may happen more often is periodic modifications for different sports. A stadium configured for baseball may well have a different capacity than the same stadium configured for football. A nice feature of vnf is that scheduled changes can be inserted ahead of time. The current capacity would continue to show up until the scheduled date arrived or if a "look-ahead" query looked to the future beyond that date.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.