Management & CommerceVery hardBusiness 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). How many rows does SELECT order_id FROM orders WHERE amount < (SELECT AVG(amount) FROM orders); return?
- A. 3
- B. 4
- C. 2
- D. 5
Correct answer: B. 4
AVG ignores the NULL: 2,450/6 ≈ 408.33. Amounts below it: 300, 200, 350 and 400 → 4 rows. The NULL row is never returned, because NULL < x is unknown, not true. Treating NULL as 0 would make the average 350 and give only 2 rows.
Practise more Operations, Supply Chain & Business Analytics questionsOperations, Supply Chain & Business Analytics: notes and key points
More Operations, Supply Chain & Business Analytics questions
- 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…
- A consumer-electronics firm's quarterly figures (₹ crore unless stated), Q1 to Q4: revenue 240, 270, 300, 330; cost of goods sold 150…
- A distributor's three warehouses last year: W1 shipped 12,000 orders (11,280 on time), held average inventory of ₹80 lakh and handled COGS…
- A distributor's three warehouses last year: W1 shipped 12,000 orders (11,280 on time), held average inventory of ₹80 lakh and handled COGS…