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