Beginner

586. Bridge Table JOIN

Learn how bridge tables connect entities in many-to-many relationships.

📘 Lesson 586 of 728 ⏱ 14 min 🎯 Advanced

A bridge table, also called a junction table, stores relationships between two entities by keeping their corresponding keys.

Bridge tables are essential for querying many-to-many relationships without storing repeated groups of values in a single column.

Use StudentCourses to connect students with courses.

SQL
SELECT
    s.StudentName,
    c.CourseName
FROM Students s
INNER JOIN StudentCourses sc
    ON s.StudentID = sc.StudentID
INNER JOIN Courses c
    ON sc.CourseID = c.CourseID;

Used in data modeling, Power BI models, relational databases, permissions, and project management systems.

  • Bridge tables connect two entities.
  • They commonly contain foreign keys.
  • They support many-to-many relationships.
  • Multiple JOINs are usually required.
  • Bridge-table duplicates should be validated.
What is a bridge table?

A bridge table stores the relationships between two entities, usually through their foreign keys.

Why use a bridge table?

It provides a structured way to represent many-to-many relationships in a relational database.

Have you finished this lesson?

Introduction to SQL – All Lessons