Exam 1z0-071 All QuestionsBrowse all questions from this exam
Question 108

Examine this SQL statement:

Which two are true? (Choose two.)

    Correct Answer: A, E

    The DELETE statement executes successfully even if the subquery selects multiple rows because the EXISTS condition only checks for the existence of at least one row in the subquery. The subquery in this SQL statement is a correlated subquery, meaning it references a column from the outer query (e.employee_id). As a result, the subquery must be executed once for each row in the EMPLOYEES table to determine whether the EXISTS condition is true for that row.

Discussion
zouveOptions: AE

A. The DELETE statement executes successfully even if the subquery selects multiple rows. This is because the EXISTS condition only checks for the existence of at least one row in the subquery, regardless of how many rows are returned. E. The subquery is executed for every row in the EMPLOYEES table. This is because the subquery is a correlated subquery, which means that it references a column from the outer query (e.employee_id). As a result, the subquery must be executed once for each row in the EMPLOYEES table to determine whether the EXISTS condition is true or false for that row.

zouve

in other words the subquery is evaluated once for each row selected by the outer query

Poke90

Why is B wrong?

TofOra

The DELETE starts running and then it calls the subquery.

TofOra

Understand that one thing is the execution of the DELETE command other is the deletion of the row.

lucemqyOptions: AE

AE is correct

karols32Options: AD

A,D. Subquery isn't query before outer query.

auwiaOptions: AB

AB are correct.