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?
- A. 5, 3, 5
- B. 4, 3, 5
- C. 4, 4, 5
- 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).
Practise more IT Officer Professional Knowledge (IBPS SO) questionsIT Officer Professional Knowledge (IBPS SO): notes and key points
More IT Officer Professional Knowledge (IBPS SO) questions
- For a table with X values (10, 20, NULL), the result of SELECT AVG(X) is:
- Which join returns all rows from both tables with NULLs for non-matches?
- A view defined with GROUP BY and aggregate functions is generally:
- Which is true of a foreign key constraint with ON DELETE CASCADE?
- With n transactions, the number of possible serial schedules is:
- Under strict two-phase locking, a transaction releases its exclusive locks: