1Z0-082 practice question 14 of 25

Which three statements are true regarding single row subqueries?

Full set: 142 questions
Answer options
A: They must be placed on the right side of the comparison operator or condition.
B: They must be placed on the left side of the comparison operator or condition.
C: They can be used in the where clause. Correct answer
D: A SQL statement may have multiple single row subquery blocks. Correct answer
E: They must return a row to prevent errors in the SQL statement.
F: They can be used in the having clause. Correct answer
Correct Answer:
C. They can be used in the where clause.; D. A SQL statement may have multiple single row subquery blocks.; F. They can be used in the having clause.
Explanation

Single-row subqueries are versatile components in SQL. They can be used in the WHERE clause to filter rows based on a single value returned by the subquery. They are also permitted in the HAVING clause to filter grouped results. Furthermore, a single SQL statement is not limited to one subquery; multiple single-row subqueries can be used in various clauses of the same statement to implement complex logic.

Why Incorrect

A. A subquery can be on either side of a comparison operator, so stating it must be on the right is incorrect.
B. A subquery can be on either side of a comparison operator, so stating it must be on the left is incorrect.
E. If a single-row subquery returns no rows, its result is NULL. This does not cause an error; the comparison condition simply evaluates to unknown.

References

Oracle Database SQL Language Reference

19c

"Subqueries". This section explicitly shows examples of subqueries in WHERE and HAVING clauses. It states

"A single-row subquery returns zero or one row...".

Oracle Database Concepts

19c

Chapter 19

"SQL". The section "Subqueries" describes their use in filtering conditions. The documentation does not impose a limit of one subquery per statement.

Scroll to Top