dimanche 1 février 2015

Soccer league ER diagram (implementing a many to many relationship)


I am planning on creating a database to track teams and players in a soccer league. The stats I wish to track are as follows...


goals scored/conceded(gk), assists, minutes played, cards received and leading scorers.


As well as overall standings and fixtures and results. I have created an ER diagram and I think I have all the required tables but have some m:n relationships which I know shouldn't exist so am hoping my relationships are correct


Update updated er diagram enter image description here


I may or may not include the second tire of this league otherwise I don't think I actually need the league table.


will it cause me any problems if i implement it as is. i am not sure if it is ok to have 2 cols in the fixtures table that are referencing one column from the teams table. And my goals_scored table has the same two fk's as my player_match table.


Am I anywhere near the right track? Any help would be appreciated.


Update: i get the following error when syncing er with db server:



Executing SQL script in server
ERROR: Error 1022: Can't write; duplicate key in table 'goals_scored'




Aucun commentaire:

Enregistrer un commentaire