Advertisements
Advertisements
Question
Which of the following SQL function is used to count the non-NULL values in a column named column_name?
Options
COUNT(*)
COUNT(column_name)
SUM(column_name)
AVG(column_name)
MCQ
Advertisements
Solution
COUNT(column_name)
Explanation:
In SQL, the COUNT(column_name) function counts only the non-NULL values in a given column.
COUNT(*)→ counts all rows (including those with NULL values).COUNT(column_name)→ counts only rows where the column has a value (not NULL).
shaalaa.com
Is there an error in this question or solution?
