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?
- A. 7
- B. 4
- C. 5
- 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.
Practise more Operations, Supply Chain & Business Analytics questionsOperations, Supply Chain & Business Analytics: notes and key points
More Operations, Supply Chain & Business Analytics questions
- Table orders(orderid, customer, region, amount) has 7 rows: (1, Asha, North, 500); (2, Ravi, South, 300); (3, Asha, North, 200); (4…
- Table orders(orderid, customer, region, amount) has 7 rows: (1, Asha, North, 500); (2, Ravi, South, 300); (3, Asha, North, 200); (4…
- Table orders(orderid, customer, region, amount) has 7 rows: (1, Asha, North, 500); (2, Ravi, South, 300); (3, Asha, North, 200); (4…
- A consumer-electronics firm's quarterly figures (₹ crore unless stated), Q1 to Q4: revenue 240, 270, 300, 330; cost of goods sold 150…
- A consumer-electronics firm's quarterly figures (₹ crore unless stated), Q1 to Q4: revenue 240, 270, 300, 330; cost of goods sold 150…
- A consumer-electronics firm's quarterly figures (₹ crore unless stated), Q1 to Q4: revenue 240, 270, 300, 330; cost of goods sold 150…