Interview Question

What is LEFT JOIN?

LEFT JOIN preserves all left-side rows.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

A LEFT JOIN keeps every row from the left input and matching rows from the right input. • Unmatched right-side columns become NULL. • More than one matching right row produces more than one result row. • Conditions placed in WHERE can accidentally remove preserved unmatched rows.

💡 SQL Example

SELECT c.name, o.order_id FROM customers c LEFT JOIN orders o ON o.customer_id = c.customer_id;

Result

Every customer, including customers without orders

⚡ Quick Revision

LEFT JOIN preserves all left-side rows.