Skip to main contentSkip to solution

Which of the following statements is TRUE with respect to SQL:

(A) AVG(COLUMN): returns the average of the non-null values in the column

(B) COUNT(COLUMN): returns the number of null values in the column

(C) MAX(COLUMN): returns the highest of the non-null values in the column

(D) SUM(COLUMN): returns the sum of the non-null values in the column

Solution

✅ Correct Option: 2

SQL aggregate functions ignore NULLs when they work on a column. So AVG(COLUMN), MAX(COLUMN) and SUM(COLUMN) each use only the non-null values, which makes (A), (C) and (D) true.


(B) is the trap: COUNT(COLUMN) returns the number of non-null values in the column, not the number of nulls. Only COUNT(*) counts every row, including those with nulls.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question