Database Management
primer-original-v2mediumDatabase Management07 Joins & Subqueryprimer-original-v2

Which SQL statement produces an error?

Answer options

A
SELECT job_id, SUM(salary) FROM emp_dept_vu WHERE department_id IN (10,20) GROUP BY job_id HAVING SUM(salary) > ;
B
SELECT * FROM emp_dept_vu;
C
SELECT department_id, job_id, AVG(salary) FROM emp_dept_vu GROUP BY department_id, job_id;
D
None of these produce an error.

Correct answer: SELECT job_id, SUM(salary) FROM emp_dept_vu WHERE department_id IN (10,20) GROUP BY job_id HAVING SUM(salary) > ;

Explanation

Quick AnswerThe correct answer is SELECT job_id, SUM(salary) FROM emp_dept_vu WHERE department_id IN (10,20) GROUP BY job_id HAVING SUM(salary) > ; because it directly addresses the core logic of Database Management.

This question has been retained as-is due to its unique context.

Related Database Management questions

Practice more Database Management questions

PrimerPrep has independently reviewed practice questions and coding exercises — all free.