| Lesson 10 | Problems with many-to-many Relationships |
| Objective | Describe the problems caused by many-to-many relationships and the symptoms that reveal them. |
Conceptually, a many-to-many (M:N) relationship is any case where one instance of A can relate to many B, and one instance of B can relate to many A. In physical relational design, modeling an M:N directly (e.g., by stuffing lists into columns or duplicating rows) leads to redundancy, anomalies, and integrity drift. This lesson explains what breaks, how to spot the problems, and why an associative entity (junction table) is required (the “how” is covered next).
Examples: Students ↔ Classes, Orders ↔ Products, Employees ↔ Projects, Authors ↔ Publications.
Quantity, UnitPriceAtOrder, EnrolledOn, Role belong to the pairing (A with B), not to either entity alone.
Without a place to put them, designs either duplicate or misplace these values.
Class1..ClassN, or duplicated entity rows) force scans, string parsing, or unions that don’t scale.
The figure below shows a Students table that attempts to embed class membership by repeating class identifiers and names in student rows. This design looks convenient but guarantees redundancy and anomalies.
| StudID | LastName | FirstName | ClassID | ClassName |
| -----: | -------- | --------- | ------: | ---------- |
| 53985 | Jones | Cindy | 854 | Finance |
| 53985 | Jones | Cindy | 768 | Statistics |
| 53985 | Jones | Cindy | 708 | Spanish II |
| 62292 | Cruz | Leo | 708 | Spanish II |
| 62292 | Cruz | Leo | 854 | Finance |
| 58889 | Smith | Joanna | 768 | Statistics |
Students table with repeated ClassID and ClassName values.
Notice the duplicate values in ClassID and the repetitive ClassName. In a real university, thousands of students taking multiple courses would explode this redundancy[1].
Now change “Spanish I” to “Introductory Spanish.” You must update every occurrence in Students in addition to the authoritative entry in Classes. Miss even one row and the database disagrees with itself.
Insert/delete operations are also brittle: you can’t add a new class until a student “uses” it (insertion anomaly), and removing a student’s last row for a class can erase the only remaining facts about that class (deletion anomaly).
Quantity, AssignedHours) that clearly describe the pair of entities, not either one alone.0..* ↔ 0..*.The relational model doesn’t implement M:N directly. The remedy is an associative (intersection, junction) entity that:
Quantity, UnitPriceAtOrder, EnrolledOn, Role).The next lesson shows the transformation step-by-step.
Summary: Modeling an M:N directly produces redundancy and the classic insert/update/delete anomalies, invites integrity drift, and slows queries. Recognize the symptoms early and plan for an associative entity to capture the pairing and its attributes. Next, we will resolve M:N into two 1:N relationships cleanly.