What is FULL OUTER JOIN?
FULL OUTER JOIN shows ALL rows from BOTH tables, whether they match or not.
Simple analogy: Show all students and all classes, whether matched or not.
Basic Example
SELECT students.name, enrollments.course
FROM students
FULL OUTER JOIN enrollments ON students.id = enrollments.student_id;Result:
- All students (even without classes)
- All classes (even without students)
When to Use
Use when you need complete data from both tables.
Example: Full inventory report showing all products and all warehouse locations.
What Comes Next
Next: Self Join (joining a table to itself)