Using ROLLUP

SELECT department, SUM(salary) 
FROM employees 
GROUP BY department WITH ROLLUP;

The NULL row shows the grand total.