Hello all,
I'm relatively new to database design and I'm looking for a nudge in the right direction here.
I'm designing a web page for a fantasy baseball league that is all friends and family. The league will span several years, fortunately we've only logged one full season in, so I can get the design right at the beginning.
At first I had a table for each year with the team_id as primary key. I realized though that might not be the best way of doing things, especially when I have to calculate the total for an entire category. Example, Home runs for 2007, home runs from 2008, etc... for a specific team. Doing it this way, I would have to access several different tables to add up the totals.
My next thought would be to have a table for each team (8 teams) and use the year as the primary key. Several spots throughout the web site will require totals for each field to be added. Also, several spots will require a function that can sift through each table (and year) and determine the highest number. So for example, the season record for home runs, it would have to look through each table and year and determine the record.
I'm kinda just wondering if I'm on the right track here or if I'm looking at it completely wrong. I also would like to know if keeping the site dynamic like this will slow it down very much? I appreciate any help or advice you can give.
Thank you
bl