Database Reference
In-Depth Information
This relationship is unresolved due to the inherent peculiarity of the many-to-many rela-
tionship. The main issue is this: How do you easily associate records from the first table
with records in the second table? To reframe the question in terms of the tables shown in
Figure 3.15 , how do you associate a single student with several classes or a specific class
with several students? Do you insert a few S TUDENT fields into the CLASSES table? Or
do you add several C LASS fields to the STUDENTS table? Either of these approaches will
make it difficult for you to work with the data in those tables and will affect data integrity
adversely. The best approach for you to take is to create and use a linking table, which will
resolve the many-to-many relationship in the most appropriate and effective manner. Fig-
ure 3.16 shows this solution in practice.
Figure 3.16. Resolving the many-to-many relationship with a linking table
It's important for you to know the type of relationship that exists between a pair of tables
because it determines how the tables are related, whether or not records between the tables
are interdependent, and the minimum and maximum number of related records that can
exist within the relationship. You'll learn much more about relationships in Chapter 10 ,
Table Relationships .
Search WWH ::




Custom Search