Which statement is true regarding the ROLLUP operator specified in the GROUP BY clause of a SQL statement?

Which statement is true regarding the ROLLUP operator specified in the GROUP BY clause of a SQL statement?

Which statement is true regarding the ROLLUP operator specified in the GROUP BY clause of a SQL statement?

A.
It produces only the subtotals for the groups specified in the GROUP BY clause.

B.
It produces only the grand totals for the groups specified in the GROUP BY clause.

C.
It produces higher-level subtotals, moving from right to left through the list of grouping columns specified in the GROUP BY clause.

D.
It produces higher-level subtotals, moving in all the directions through the list of grouping columns specified in the GROUP BY clause.



Leave a Reply 3

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


Subham

Subham

the answeer will be C
here is the example

SQL> sELECT deptno,sal,
2 SUM(sal) AS salary
3 FROM emp
4 GROUP BY ROLLUP (deptno,sal ) ;

DEPTNO SAL SALARY
—— ——— ———-
10 1300.00 1300
10 5000.00 5000
10 2450.00 2450
10 8750
20 1100.00 1100
20 3000.00 6000
20 8000.00 8000
20 2975.00 2975
20 18075
30 1500.00 1500
30 1600.00 1600
30 950.00 950
30 1250.00 1250
30 2850.00 2850
30 12500.00 12500
30 20650
47475

17 rows selected

user

user

You mean the example show the subtotals calculated from right to left ?

networkmanagers

networkmanagers

I choose C