Many-to-many join with bridge table
SQL
Medium
2 views
Problem Description
Students and Courses are many-to-many via Enrollment. Show student_name and course_name.
Sample Test Case
Input:
Students, Courses, Enrollment
Official Solution
SELECT s.name AS student_name, c.name AS course_name FROM Enrollment e JOIN Students s ON s.student_id = e.student_id JOIN Courses c ON c.course_id = e.course_id;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!