Management & CommerceModerateBusiness 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(amount) FROM orders; return?

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

Correct answer: B. 6

COUNT(column) skips NULLs. Order 4 has a NULL amount, so the result is 6; COUNT(*) would return 7.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic