Question:

Given the following table:

ENOSALARY
A1014000
B109NULL
C5086000
A3052000

State the output of the following query:

SELECT COUNT(SALARY) FROM EMPLOYEE;  

Show Hint

\texttt{COUNT()} counts all rows including NULLs, while \texttt{COUNT(column)} ignores NULL values.
Updated On: Sep 18, 2025
  • 4
  • 2
  • 3
  • 1
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Understanding COUNT(column).
The SQL \texttt{COUNT(column)} function counts only the non-NULL values in a column.
Step 2: Identify non-NULL salaries.
From the table: Salaries = 4000, NULL, 6000, 2000.
Valid non-NULL values = 3.
Step 3: Output.
\[ \text{COUNT(SALARY)} = 3 \]
Final Answer: \[ \boxed{3} \]
Was this answer helpful?
0
0

Questions Asked in CUET exam

View More Questions