select last_name, ( select count (*) from departments) from employees where sala
ID: 3643705 • Letter: S
Question
select last_name, ( select count (*) from departments) from employeeswhere salary = (select salary from employees);
What is wrong with it?
Choose one answer.
A. Nothing is wrong-the statement should run without error.
B. The statement will fail because the subquery in the SELECT list references a table that is not listed in the FROM clause.
C. The statement will fail if the conditional subquery returns more than one row.
D. The statement will run but is extremely inefficient because of the need to run the second subquery once for every row in EMPLOYEES.
Explanation / Answer
C. The statement will fail if the conditional subquery returns more than one row.
we can use "=" operator only when the sub-query returns only one row
other wise we have to use operators like "ANY", "ALL"...etc.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.