1z0-071 Exam QuestionsBrowse all questions from this exam

1z0-071 Exam - Question 160


You must find the number of employees whose salary is lower than employee 110.

Which statement fails to do this?

Show Answer
Correct Answer: AD

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'.

Discussion

13 comments
Sign in to comment
alic_alexOption: A
Mar 9, 2023

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

zouveOption: A
Jun 26, 2023

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);

Arth1989Option: A
Jan 11, 2024

alic_alex, I am sorry but where did you see the EXIST condition in A?

7dc4ae8Option: A
Jun 6, 2024

A fails

jfc1Option: C
Mar 3, 2023

A,B,D give the same result. But C is different I suggest C

BeeshoOption: A
Mar 6, 2023

i would say A

DarnunOption: A
Mar 29, 2023

A fails due to the wrong condition in subquery

Rik92Option: A
Apr 12, 2023

Answer by alic_alex explains it well.

lucemqyOption: A
Nov 16, 2023

A is correct

deepzsivaOption: A
Jan 18, 2024

Correct Answer is A. Tested.

[Removed]Option: A
Mar 24, 2024

Because it is incorret

ArslanAltafOption: A
May 5, 2024

AD Both similar results. A should be preferred

TomZhOption: A
Jun 20, 2024

A -failed with "ORA-01427: single-row subquery returns more than one row"