Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/lsp4you/public_html/connect.php on line 2 LSP4YOU - Learner's Support Publications

SELECT with GROUP BY

Q:16
Display total salary paid in each Department.


SQL> SELECT DEPARTMENT, SUM(TOTAL) FROM EMPLOYEE GROUP BY DEPARTMENT;

DEPARTMENT                SUM(TOTAL)
------------------------- ----------
ACCOUNTS                       42000
FINANCE                        70000
IT                             84000
SALES                          49000