Management & CommerceHardCAT · XAT

Table customers has rows (1, Asha), (2, Bala), (3, Chitra), (4, Dev). Table orders(cust_id, amt) has (1, 100), (1, 200), (2, 50), (5, 70). The query SELECT COUNT(*) FROM customers c LEFT JOIN orders o ON c.id = o.cust_id returns

  1. A. 4
  2. B. 5
  3. C. 3
  4. D. 6

Correct answer: B. 5

Asha matches 2 orders, Bala 1, and Chitra and Dev appear once each with NULLs: 2 + 1 + 1 + 1 = 5. The order for customer 5 has no customer row, so it is dropped by a left join.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic