Junction Table

A table that represents a many-to-many relationship through foreign keys.

What is Junction Table in a relational database?

Junction Table — A table that represents a many-to-many relationship through foreign keys.

CREATE TABLE enrollment (
    student_id INTEGER REFERENCES student (student_id),
    course_id INTEGER REFERENCES course (course_id),
    PRIMARY KEY (student_id, course_id)
);

Level: Journeyman · More Database terms at this level

Updated