Management & CommerceHardBusiness analyst · KPO · MBA placement pattern

Table orders(order_id, customer, region, amount) has 7 rows: (1, Asha, North, 500); (2, Ravi, South, 300); (3, Asha, North, 200); (4, Meena, East, NULL); (5, Ravi, South, 700); (6, John, North, 400); (7, Meena, East, 350). Table customers(name, tier) has 4 rows: (Asha, Gold), (Ravi, Silver), (Kiran, Gold), (John, Bronze). How many rows does SELECT * FROM customers c INNER JOIN orders o ON c.name = o.customer; return?

  1. A. 7
  2. B. 4
  3. C. 5
  4. D. 28

Correct answer: C. 5

An inner join keeps only matching pairs: Asha 2 orders, Ravi 2, John 1 = 5. Kiran has no orders and Meena is not a customer, so neither appears. 28 = 4 × 7 is the cross join.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic