ROLLUP provides aggregations only for each combination of ‘Department‘ and ‘Employee‘, while CUBE gives a detailed breakdown including each ‘Department‘, each ‘Employee‘, and a grand total.
ROLLUP generates hierarchical aggregations starting from the leftmost column in the GROUP BY clause.
It would produce subtotals for each ‘Department‘, subtotals for each combination of ‘Department‘ and ‘Employee‘, and a grand total.
CUBE creates aggregations for all possible combinations of the columns in the GROUP BY clause. It would generate subtotals for each ‘Department‘, each ‘Employee‘, each combination of ‘Department‘ and ‘Employee‘, and a grand total.
Neither ROLLUP nor CUBE will generate subtotals for individual ‘Departments‘ or ‘Employees‘; they only provide a grand total.
Both ROLLUP and CUBE produce identical aggregations, including subtotals for each ‘Department‘, each ‘Employee‘, each combination of ‘Department‘ and ‘Employee‘, and a grand total.
None