A report must list every customer with the number of orders each has placed, including customers who have never ordered, who should appear with a count of 0. Which FROM clause supports this report?
Select an answer to reveal the explanation.
Short Explanation
A LEFT JOIN is a guest list that keeps everybody on the left side, even the folks who didn't bring a plus-one. Put customers on the left and you keep the ones with no orders. The trap is INNER JOIN, which quietly drops anyone without a match, so your zero-order customers just vanish.
Full Explanation
A LEFT OUTER JOIN returns every row from the table on its left side and the matching rows from the right side; where no match exists, the right-side columns come back as NULL. With customers on the left, every customer appears at least once, and pairing the join with COUNT(o.order_id) and GROUP BY on the customer yields 0 for customers whose order columns are NULL, because COUNT of a column ignores NULLs. An INNER JOIN returns only rows that match in both tables, so customers with no orders disappear from the result instead of showing a zero, which is the exact defect the report must avoid. A CROSS JOIN pairs every customer with every order regardless of ownership, producing a Cartesian product whose counts would be the total number of orders for every customer. Reversing the tables in a LEFT OUTER JOIN preserves every order rather than every customer, so customers without orders still have nothing to join to and are left out. Exam caveat: COUNT(*) would count the NULL-extended row and report 1 for customers with no orders, so the counted column matters as much as the join type. Operational check: create a test customer with no orders, run the report, and confirm that customer appears with a count of 0 and that the total row count equals the number of customers.