nerdexam
Oracle

1Z0-007 · Question #28

Examine the data from the ORDERS and CUSTOMERS tables. Evaluate the SQL statement: SELECT * FROM orders WHERE cust_id = (SELECT cust_id FROM customers WHERE cust_name = 'Smith'); What is the result…

The correct answer is D. Option D. The query fails because the sub-query returns more than one row: it is possible situation when there are some customers with name Smith. Incorrect Answers A: The query fails because the sub-query returns more than one row B: The query fails because the sub-query returns more…

Displaying Data from Multiple Tables and Subqueries

Question

Examine the data from the ORDERS and CUSTOMERS tables. Evaluate the SQL statement:

SELECT * FROM orders WHERE cust_id = (SELECT cust_id FROM customers WHERE cust_name = 'Smith'); What is the result when the query is executed?

Exhibits

1Z0-007 question #28 exhibit 1
1Z0-007 question #28 exhibit 2

Options

  • AOption A
  • BOption B
  • COption C
  • DOption D
  • EOption E

How the community answered

(60 responses)
  • A
    7% (4)
  • B
    15% (9)
  • C
    2% (1)
  • D
    73% (44)
  • E
    3% (2)

Explanation

The query fails because the sub-query returns more than one row: it is possible situation when there are some customers with name Smith. Incorrect Answers A: The query fails because the sub-query returns more than one row B: The query fails because the sub-query returns more than one row C: The query fails because the sub-query returns more than one row E: The query fails because the sub-query returns more than one row, not because the outer query and the inner query are using different tables.

Topics

#single-row subquery#equality operator#WHERE clause#correlated tables

Community Discussion

No community discussion yet for this question.

Full 1Z0-007 Practice