Oracle
1Z0-047 · Question #26
View the Exhibit and examine DEPARTMENTS and the LOCATIONS tables. Evaluate the following SOL statement: SELECT location_id, city FROM locations I WHERE NOT EXISTS (SELECT location_id FROM…
The correct answer is C. The statement would execute but it will return zero rows because the WHERE clause in the inner. See the full explanation below for the reasoning.
Question
View the Exhibit and examine DEPARTMENTS and the LOCATIONS tables. Evaluate the following SOL statement:
SELECT location_id, city FROM locations I WHERE NOT EXISTS (SELECT location_id FROM departments WHERE location_id <> I. location_id); This statement was written to display LOCATIONJD and CITY where there are no departments located. Which statement is true regarding the execution and output of the command?
Exhibit
Options
- AThe statement would execute and would return the desired results.
- BThe statement would not execute because the = comparison operator is missing in the WHERE
- CThe statement would execute but it will return zero rows because the WHERE clause in the inner
- DThe statement would not execute because the WHERE clause in the outer query is missing the
How the community answered
(57 responses)- A5% (3)
- B11% (6)
- C81% (46)
- D4% (2)
Community Discussion
No community discussion yet for this question.
