Professional KnowledgeHardIBPS SO IT

Table T has column X with values (1, 2, NULL, 2, 3). What does SELECT COUNT(X), COUNT(DISTINCT X), COUNT(*) return?

  1. A. 5, 3, 5
  2. B. 4, 3, 5
  3. C. 4, 4, 5
  4. D. 4, 3, 4

Correct answer: B. 4, 3, 5

COUNT(X) ignores NULL (4), DISTINCT ignores NULL and duplicates (3), COUNT(*) counts rows (5).

More IT Officer Professional Knowledge (IBPS SO) questions

Exams that ask this topic