Many-to-many (ERD)

A many-to-many relationship needs a join entity as soon as the diagram is physical rather than conceptual. This example draws both sides of that decision.


#What this example shows

  • A join entity carrying its own attributes.

  • Two one-to-many relationships replacing one many-to-many.

  • Why the join entity is the honest version.


#A worked example

Open it, edit it, or copy the source below.

Many-to-many (ERD)

The source, which you can paste into a new diagram and edit:

[Student]
*id
name
year

[Course]
*id
code
title
credits

[Enrolment]
*id
+student_id
+course_id
enrolled_on
grade

Enrolment *--1 Student
Enrolment *--1 Course

#Making it your own

  • The moment a relationship has attributes of its own, it is an entity.

  • A bare many-to-many is fine on a conceptual diagram and wrong on a physical one.

  • Name the join entity for what it is, not StudentCourse.



Four symbols, and that is the language.