Page 71 - Database-En-V3
P. 71

4- The following one-to-many relationship appears as in the
                 picture:

          • Many-to-Many relationship
              In this type of relationship, a row in table A can have many
              identical rows in table B, and vice versa. You can create this
              relationship through a third table, or what is called the
              intermediate table or connection table, whose primary key is
              two foreign keys from both table A and table B.
               o For example, the student data table, calculators, and the
                  study subjects table, have a many-to-many relationship
                  because a student can register more than one study
                  subject, and also the study subject can have more than
                  one student enter it.
               o In order to create this relationship, you must create a
                  connection table, which is the students table with
                  academic subjects, then create a one-to-many
                  relationship between the computers students table and
                  the students with academic subjects, and create a second
                  one-to-many relationship between the academic subjects
                  table and the students table with academic subjects.

64 Training unit in the field of technological information - at the Supreme Council of Universities © Intellectual property rights 2024
   66   67   68   69   70   71   72   73   74   75   76