Interview Question

What is FULL OUTER JOIN?

FULL OUTER JOIN preserves unmatched rows from both sides.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

A FULL OUTER JOIN keeps matched rows plus unmatched rows from both inputs. • Missing columns from the opposite side are filled with NULL. • It is useful when comparing two sets for matches and differences. • Not every database product supports this syntax directly.

💡 SQL Example

SELECT a.id AS old_id, b.id AS new_id FROM old_items a FULL OUTER JOIN new_items b ON b.id = a.id;

Result

Matched, removed, and added item identifiers

⚡ Quick Revision

FULL OUTER JOIN preserves unmatched rows from both sides.