QuestionQ95Verified/Using Subqueries to Solve QueriesCopy linkReport a problemAsk AstroTutorSave questionReview the following SQL statement: Which two statements are true?Choose twoAAll existing rows in the ORDERS table are updated.BThe subquery is executed before the UPDATE statement is executed.CThe subquery is not a correlated subquery.DThe subquery is executed for every updated row in the ORDERS table.EThe UPDATE statement executes successfully even if the subquery selects multiple rows.Show AnswerAnswerExplanationWithout a WHERE clause, an UPDATE targets all rows in the target table. The reference to o.customer_id is an outer-row reference, so the subquery is correlated and is conceptually evaluated for each row processed by the UPDATE. Oracle requires a subquery used to assign a single column in an UPDATE to return exactly one row per updated row; multiple rows produce an error.Learn moreOracle Database SQL Language Reference: UPDATEOracle Database SQL Language Reference: Using SubqueriesShow comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion