View the Exhibit and examine the description for EMPLOYEES and DEPARTMENTS tables.
Evaluate the following SQL statement:
SELECT e.department_id, e.job_id, d.location_id, sum(e.salary) total FROM employees e JOIN departments d
ON e.department_id = d.department_id
GROUP BY CUBE (e.department_id, e.job_id, d.location_id);
Which two statements are true regarding the output of this command? (Choose two.)
A.
The output would display the total salary for all the departments.
B.
The output would display the total salary for all the JOB_IDs in a department.
C.
The output would display only the grand total of the salary for all JOB_IDs in a LOCATION_ID.
D.
The output would display the grand total of the salary for only the groups specified in the GROUP BY clause.
why is D incorrect?
The output would display the grand total for all the group in the group by or also the select clause
For C:
SELECT e.department_id, e.job_id, d.location_id, sum(e.salary) total
FROM employees e JOIN departments d
ON e.department_id = d.department_id
GROUP BY CUBE (e.department_id, e.job_id, d.location_id)
order by location_id, job_id;