Multiple choice technology databases

In which sceneria would you use the ROLLUP operator for expresiion or column with in a GROUPBY clause?

  1. To find the groups forming the subtotal in a row

  2. To create group-wise totals for the groups specified within a GROUPBY clause

  3. To create grouping for expressions or columns specified within a GROUPBY clause in one direction,from right to left for calculating the subtotals.

  4. To create grouping for expressions or columns specified within a GROUPBY clause in all possible direction,which is cross-tabular report for calculating the subtotals

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

ROLLUP creates subtotals in a right-to-left direction through the GROUP BY columns. For example, ROLLUP(A,B,C) creates subtotals for (A,B,C), then (A,B), then (A), then the grand total. This differs from CUBE which creates all possible combinations.