在关系数据库(如MySQL)中,有公司员工收入表t_income,包含字段:dept 部门、name员工姓名、income收入。现要统计每个员工的总收入、每个部门的总收入和全公司的总收入,可以用以下哪个SQL语句实现?(正确答案个数:2个)
A. select dept,name,sum(income) from t_income group by dept,name with cube;
B. select dept,name,sum(income) from t_income group by dept,name with rollup;
c. select dept,name,sum(income) from t_income group by dept,NAME union all select dept,",sum(income) from t_income group by dept union all select ", ",sum(income) from t_income;
D.select dept,name,sum(income) from t_income group by dept,NAME union all select dept,",sum(income) from t_income group by dept union all select ",name,sum(income) from t_income group by name union all select ",",sum(income) from t_income;
正确答案为B\C项
请帮忙解释一下为什么C项正确