QuestionQ215

VerifiedManipulating Data

You work as a database administrator at ABC.com. Review the exhibit carefully.

Exhibit:

Question Image

Then examine the structure of the CUSTOMRS and SALES tables.

Evaluate the following SQL statement.

Exhibit:

Question Image

Which statement is true about execution of the preceding UPDATE statement?

Explanation

Oracle allows an UPDATE statement to target the columns returned by an updatable subquery. Because the inline view selects from the single SALES base table and includes TIME_ID, Oracle can update that column in the qualifying SALES rows. A scalar subquery is valid in an UPDATE WHERE clause, and its reference to CUSTOMERS does not make the operation a two-table update. Oracle documents that an UPDATE target can be a subquery and that a WHERE clause can limit the rows updated.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!