MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is true of using group functions on columns that contain NULL values?
A
Group functions on columns ignore NULL values.
B
Group functions on columns returning dates include NULL values.
C
Group functions on columns returning numbers include NULL values.
D
Group functions on columns cannot be accurately used on columns that contain NULL values.
Explanation: 

Detailed explanation-1: -Group functions on columns cannot be accurately used on columns that contain NULL values.

Detailed explanation-2: -Answer: Explanation: Group functions ignore null values-is true about a group function. Mathematical operations on sets of rows to produce one result per set are known as group functions.

Detailed explanation-3: -Group functions ignore the NULL values in the column. To enforce the group functions ti include the NULL value, use NVL function. For example, the following statement forces to take the average for all salary values even including 0 (although it is an odd case, let’s assume this is possible.)

Detailed explanation-4: -An aggregate function performs a calculation on a set of values, and returns a single value. Except for COUNT(*), aggregate functions ignore null values. Aggregate functions are often used with the GROUP BY clause of the SELECT statement.

Detailed explanation-5: -MAX, COUNT, SUM are the group functions that ignore NULL values. When using group functions like MAX, COUNT, and SUM the set of rows that are grouped if it contains NULL values then also it will give us the result.

There is 1 question to complete.