---
answer: direct
beat: system-design
source: 1 article · updated: November 14, 2026
---

How do I model a many-to-many relationship?

With a junction table holding the two foreign keys, usually as a composite primary key, plus any attributes of the relationship itself. Students and courses become a third table, enrollments, that can also store the enrolment date and grade.

Answered in

Relational Schema Design That Survives Contact With Production

Keys, relationships, constraints and indexes: the schema decisions that decide integrity and speed, with worked SQL for one-to-many and many-to-many.

Crashtech Editorial November 14, 2026 System Design & Architecture

Read the full analysis

Other questions this article answers

More system design & architecture questions

Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design & Architecture beat.