I\'m trying to simplify a database structure, and I have two tables matches and team_statistics:
Here in the team_statistics
I think you need to track teams to groups somewhere. Something like:
CREATE TABLE team_groups (
team_id int,
group_id int,
primary key (team_id, group_id)
);
then you need the matches table to have two foreign keys against this. Then your statistics table should reference that as well.
You could aso create multiple foreign keys from team_statistics to matches but if you do this, you will run into an inability to grab statistics until a team is both on one side and the other side of a match.