as of right now I'm trying to design a database which contains data involving football matches. I have two tables: Match & Football Team both containing various attributes. These are connected via many to many relationship. As far as I understand, I need a join table. In that table, I would need to contain ID of the match and IDs of both teams. Am I right or is this design flawed? I'm just a beginner when it comes to databases so I would appreciate some help.
-
What is your 1 specific researched non-duplicate question re how/why you are 1st stuck on what step among which steps following what published presentation of what design method/process given what? Right now you are essentially asking us to (re)write a textbook with bespoke tutorial with no details on what you misunderstand or do or don't understand. How to Ask Help center Basic questions are faqs. PS Your diagram does not agree with your prose description, and is not a reasonable design.– philipxyNov 22, 2022 at 1:22
-
Please use text, not images/links, for text--including tables & ERDs. Why are images of text, code and mathematical expressions discouraged? Use images only for what cannot be expressed as text or to augment text. Include a legend/key & explanation with an image. An ERD is an illustration of DDL.– philipxyNov 22, 2022 at 1:22
-
Hi, and welcome to dba.se! Why have two match tables? I'd do something more like this.– VéraceNov 22, 2022 at 8:59
1 Answer
Data model is often a matter of opinion, so here's mine: there is no "many to many" relationship between teams and matches; there is "many to exactly two". In other words, the home and away teams are attributes of a match; a match would be meaningless without either. Subsequently, you don't need the junction table.