Answer:
WITH deptsalary AS (
SELECT dept, SUM(salary)
FROM emp
GROUP BY dept)
SELCT *
FROM deptsalary
Step-by-step explanation:
deptsalary is temporary table.
dept and its respective sum of salary is to be displayed
9.4m questions
12.2m answers