r/DatabaseHelp • • Dec 14 '16

Critique my Schema

This one started out a simple web-scraping project, and is now becoming quite a daunting yet-fun project to a programming/database noob like me.

I'm basically building a database of soccer leagues. And, like in every sport, you have seasons ("2015-2016" and "2016-2017"), and in each season you have different teams (some were regulated/promoted to other leagues), placed in different rankings after different match-weeks/rounds, according to the performance in matches.

Anyway, what I want to do is extrapolate from individual soccer match scores (ex.: "Chelsea FC 2 : 1 Manchester United") the table standings by season. Let's assume that all the data (league name ,season (year), teams names, final score) comes pretty much bundled inside the HTML source page.

Don't ask why I'm not just scraping the individual tables by season, there is a reason =) (example: "Where was team X positioned in the 14th round of the 2004-2005 season?")

I've put together a schema map (Haven't entered any actual columns yet) which I think should do and I'd love some feedback.

1 Upvotes

15 comments sorted by

View all comments

Show parent comment

1

u/nonzerogroud Dec 15 '16

This does make sense. However, I thought normalization means we're not even keeping rankings for specific seasons per se.

Rather, we are filtering via the separate one-to-many relationship with multiple joins. So, "give me all the matches for teams in season = 2016 of league = English Premier League" will yield the same result as long as we're somehow calculating the match results in all of the rounds where season = 2016. Am I making sense?