問題文
A customers table has one row per customer. An orders table has one row per order, and a customer can have many orders. The analyst writes a query that joins customers to orders on the customer key and then counts the rows. The result is much larger than the number of customers. What does this indicate?
選択肢
- The orders table has a declared foreign key that is not enforced, and unenforced keys cause the optimizer to emit each matching row twice.
- The join is behaving normally: one customer row is repeated once for each of its orders, so the row count reflects orders, not customers.
- The join key contains NULL values, and NULL keys match every row in that table on the other side, which inflates the result.
- An inner join was used where a left join was required, and inner joins duplicate rows while left joins do not.