Which two statements are true about the GROUPING function?

Which two statements are true about the GROUPING function? (Choose two.)

Which two statements are true about the GROUPING function? (Choose two.)

A.
It is used to find the groups forming the subtotal in a row.

B.
It is used to identify the NULL value in the aggregate functions.

C.
It is used to form the group sets involved in generating the totals and subtotals.

D.
It can only be used with ROLLUP and CUBE operators specified in the GROUP BY clause.



Leave a Reply 7

Your email address will not be published. Required fields are marked *


Sandhya

Sandhya

A and B are correct answers.

kongo

kongo

Correct answers:

B.
It is used to identify the NULL value in the aggregate functions.
D.
It can only be used with ROLLUP and CUBE operators specified in the GROUP BY clause.

Jackson

Jackson

GROUPING distinguishes superaggregate rows from regular grouped rows. GROUP BY extensions such as ROLLUP and CUBE produce superaggregate rows where the set of all values is represented by null. Using the GROUPING function, you can distinguish a null representing the set of all values in a superaggregate row from a null in a regular row.

http://docs.oracle.com/cd/B28359_01/server.111/b28286/functions064.htm

Ans is B and D

user

user

but this answer is incorrect in Question 9:

In which scenario would you use the ROLLUP operator for expression or columns within a GROUP BY clause?
A. to find the groups forming the subtotal in a row

user

user

select grouping(job), sum(sal) from emp group by rollup (job);

alis

alis

For D
Not only CUBE and ROLLUP

Missing GROUPING SETS

SELECT … [GROUPING(dimension_column)…] …
GROUP BY … {CUBE | ROLLUP| GROUPING SETS} (dimension_column)

seenagape

seenagape

Correct answer is AD