Management & CommerceEasyBusiness 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). What does SELECT COUNT(*) FROM orders WHERE region = 'North'; return?
- A. 2
- B. 7
- C. 3
- D. 4
Correct answer: C. 3
WHERE keeps only the North rows (orders 1, 3 and 6) and COUNT(*) counts rows, so the answer is 3. 7 ignores the filter, and 2 is the number of distinct North customers (Asha, John), which would need COUNT(DISTINCT customer).
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…
- 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…