Skip to main contentSkip to solution

Given the following table:

EMPLOYEE

ENOSALARY
A1014000
B109NULL
C5086000
A3052000

State the output of the following query based on the above given table.

SELECT COUNT(SALARY) FROM EMPLOYEE;

Solution

✅ Correct Option: 3

COUNT(column) counts only the non-NULL values in that column. SALARY has the values 4000, 6000 and 2000, and the NULL for B109 is skipped, so the result is 3.


Option 1: 4 is the result of COUNT(*), which counts all rows including those with NULL.

Keyboard Shortcuts

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