Listing B


ttitle 'Employee Salary|Cubic Rollup'
 

col deptno   heading 'Department|Number'

col job      heading 'Job|Title'

col num_emps heading 'Number of|Employees' format 9,999

col sum_sal  heading 'Total|Salary'        format $99,999
 

SELECT

   deptno,

   job,

   count(*)  num_emps,

   sum(sal)  sum_sal

FROM

   emp_ext

GROUP BY

   ROLLUP

   (

      deptno,

      job

   );