B
B
Bjornie2017-02-05 22:11:33
MySQL
Bjornie, 2017-02-05 22:11:33

Have I designed the data connection in the DB correctly?

There are 3 categories of data, each dependent on the other:

  1. Region
  2. Discipline
  3. Groups
  • End point - group selection (3). which will already show the list of matches in the group.
  • Each region (1) has its own disciplines (2), for the selected discipline its own groups (3) are assigned.
  • Further, in each group, a list of matches that are tied to a specific group is displayed.

- The number of regions will be small, about 30.
- Each region can have 100 disciplines (all different! unique).
- Each discipline can have 100 groups (all different! unique).
The search will be carried out in groups, as the last link in the selection criteria.
Did I draw the diagram correctly? e032dbea183c4096ab72a8a52a147df6.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zergon321, 2017-02-05
@zergon321

Regions - disciplines and disciplines - groups - apparently, a many-to-many relationship (in one region there are many disciplines, but the same discipline, football, for example, can be in several regions, the same with groups). Do this: disciplines, regions and groups - in separate tables, where there are only their id and names. The fourth table consists of the id of the region, the id of the discipline and the id of the group, as well as the id of the entry itself in the 4th table. record id from the 4th table - a foreign key for records in the matches table. By the way, in your case, such a scheme will help save a lot of space on the hard drive of the database server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question