ExamVeda
Login
Home
This question belongs to SQL Sql Miscellaneous
Sql Miscellaneous
?

Which of the following group functions ignore NULL values?

Answer & Solution
Correct Answer: Option D
All three of the listed SQL group functions, MAX, COUNT, and SUM, have the ability to ignore NULL values when processing data within their respective functions. Here's a brief explanation of each option:

Option A: MAX
The MAX function is used to find the maximum (largest) value in a set of values. It can operate on a column and will return the maximum value, ignoring NULL values in that column.

Option B: COUNT
The COUNT function is used to count the number of rows in a result-set or the number of non-NULL values in a specific column. It ignores NULL values when counting.

Option C: SUM
The SUM function is used to calculate the sum of all values in a numeric column. It adds up all the non-NULL values and produces a result, ignoring NULL values.

Option D: All of the above
This option is correct because all of the mentioned group functions (MAX, COUNT, and SUM) have the capability to ignore NULL values when performing their respective operations.

So, the correct answer is Option D: All of the above.
Examveda
Question posted by Examveda
Community

Join the Discussion

3 Comments
Somesh Mishra
Somesh Mishra 8 years ago
Answer D
Reason:
1. MAX: Will check for the possible numeric value in the database. Hence Ignore NULL.
2. Count : select Count(name) from xyz, this will Return 0 if Found NULL in name of all records {NULL is getting ignore},
whereas count(1) will return number of rows.
3.SUM: SUM is basically used to add Amount Type Fields in DB. 0 + NULL Will create NULL.
Vinod Morampudi
Vinod Morampudi 8 years ago
why group functions ignore null values
Pranav Madhani
Pranav Madhani 9 years ago
All aggregate functions above ignore NULL values except for the COUNT function.