Back 

Many-to-many relationships

Introduction
The symbol used to represent a many-to-many relationship is:

er7

Here is an example of a many-to-many relationship:

er8

Describing relationships
Using the same method as before, we need to describe the relationship with two sentences:

    • Each pupil studies many GCSEs.
    • Each GCSE is studied by many pupils.

How would you implement this database? To help us understand the design, we will put some records in the tables, as before.

er9

This is a far from ideal solution! For a start, how many attributes will you need in the GCSE table? You could have many indeed if there were lots of pupils taking a particular GCSE. More importantly, however, is that you (or rather Access or whichever software you are using) are going to have a problem recombining the two tables back into one! For example, a record in the GCSE table doesn't match to just one record in the pupil table. One GCSE will match back to many different records in the pupil table. This is not good! We need to 'resolve' the relationship.

Back