Home › Interview Questions › Explain why using a LEFT JOIN on orders.customer_i…

Explain why using a LEFT JOIN on orders.customer_id = customers.id is the correct approach to combine orders and customers tables, and how it affects the result set.

🟢 Easy Conceptual Fresher level
1Times asked
Nov 2026Last seen
Nov 2026First seen

šŸ’” Model Answer

A LEFT JOIN returns all rows from the left table (customers) and the matched rows from the right table (orders). If a customer has no orders, the order columns are NULL. This preserves every customer in the result, which is useful when you need to report on all customers, even those without activity. An INNER JOIN would drop customers with no matching orders. The LEFT JOIN also allows you to aggregate orders per customer using GROUP BY, ensuring that customers with zero orders can be represented with a total of NULL or 0 depending on how you handle NULLs.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

šŸŽ¤ Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500