You must find the number of employees whose salary is lower than employee 110.
Which statement fails to do this?
You must find the number of employees whose salary is lower than employee 110.
Which statement fails to do this?
The statement in option A fails to find the number of employees whose salary is lower than employee 110 because it uses an incorrect reference in the subquery. The subquery references the outer query's table alias (e.employee_id) instead of its own alias (a.employee_id), which causes an error since the subquery does not have a limitation to fetch rows properly. This mistake results in an error commonly referred to as 'ORA-01427: single-row subquery returns more than one row'.
fail A - because in the subquery exist condition referenced to main table but not subquery table. By other words, in the subquery not exist limitation for fetching rows and subquery return more than one row
A fails
alic_alex, I am sorry but where did you see the EXIST condition in A?
is the A the correct A is select count(*) from hr.employees e where e.salary < (select a.salary from hr. employees a where a.employee_id=110);
A -failed with "ORA-01427: single-row subquery returns more than one row"
AD Both similar results. A should be preferred
Because it is incorret
Correct Answer is A. Tested.
A is correct
Answer by alic_alex explains it well.
A fails due to the wrong condition in subquery
i would say A
A,B,D give the same result. But C is different I suggest C