1. Write a query to display the following for those employees whose manager ID is less than 120: – Manager ID – Job ID and total salary for every job ID for employees who report to the same manager – Total salary of those managers – Total salary of those managers, irrespective of the job IDs SELECT manager_id,job_id,sum(salary) FROM employees WHERE manager_id < 120 GROUP BY ROLLUP(manager_id,job_id); 2. Observe the output from question 1. Write a query using the GROUPING function to determine whether the NULL values in the columns corresponding to the GROUP BY expressions are caused by the ROLLUP operation. SELECT manager_id MGR ,job_id JOB, sum(salary),GROUPING(manager_id),GROUPING(job_id) FROM employees WHERE manager_id < 120 GROUP BY ROLLUP(manager_id,job_id); 3. Write a query to display the following for those employees whose manager ID is less than 120 : – Manager ID – Job and total salaries for every job for employees who report to the same manager – Total salary of those managers – Cross-tabulation values to display the total salary for every job, irrespective of the manager – Total salary irrespective of all job titles SELECT manager_id, job_id, sum(salary) FROM employees WHERE manager_id < 120 GROUP BY CUBE(manager_id, job_id); 4. Observe the output from question 3. Write a query using the GROUPING function to determine whether the NULL values in the columns corresponding to the GROUP BY expressions are caused by the CUBE operation. SELECT manager_id MGR ,job_id JOB, sum(salary),GROUPING(manager_id),GROUPING(job_id) FROM employees WHERE manager_id < 120 GROUP BY CUBE(manager_id,job_id); 5. Using GROUPING SETS, write a query to display the following groupings : – department_id, manager_id, job_id – department_id, job_id – Manager_id, job_id The query should calculate the sum of the salaries for each of these groups. SELECT department_id, manager_id, job_id, SUM(salary) FROM employees GROUP BY GROUPING SETS ((department_id, manager_id, job_id), (department_id, job_id),(manager_id,job_id));