exam questions

Exam 1z0-071 All Questions

View all questions & answers for the 1z0-071 exam

Exam 1z0-071 topic 1 question 8 discussion

Actual exam question from Oracle's 1z0-071
Question #: 8
Topic #: 1
[All 1z0-071 Questions]

Examine this SQL statement:

Which two are true? (Choose two.)

  • A. All existing rows in the ORDERS table are updated.
  • B. The subquery is executed before the UPDATE statement is executed.
  • C. The subquery is not a correlated subquery.
  • D. The subquery is executed for every updated row in the ORDERS table.
  • E. The UPDATE statement executes successfully even if the subquery selects multiple rows.
Show Suggested Answer Hide Answer
Suggested Answer: AD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
meddheddy
Highly Voted 2 years, 3 months ago
A and D tested on Oracle 12c1
upvoted 14 times
...
Drexan
Most Recent 2 months, 2 weeks ago
Selected Answer: AD
No WHEN in update: all rows will be updated. Correlated subquery, will execute for every row in the upddate
upvoted 1 times
...
Ramileu
6 months, 2 weeks ago
SHOULD BE b AND d
upvoted 1 times
...
Fredderik91
8 months ago
Selected Answer: AD
B (false), depending EXPLAIN PLAN. no always is executed first. C (false), ".o" is correlative E (false) is possible multiple rows, an error more than row. A and D is correct
upvoted 2 times
...
hmatinnn
12 months ago
Selected Answer: AD
sHOULD BE a AND d
upvoted 1 times
...
Lee_jong_suk
1 year, 1 month ago
AD option is right
upvoted 1 times
...
jm9999
1 year, 3 months ago
AD; cannot be B, correlated subqueries are not executed before the parent (outer) query. Cannot be E, cannot set customer_name to multiple values for each row
upvoted 1 times
...
HassanMkhlalati
1 year, 4 months ago
Selected Answer: AD
A is correct D :It will retrieve the matching value for each row from the table orders with the table customers
upvoted 1 times
...
Fredderik91
1 year, 7 months ago
BD, A is incorrect only matching rows are updated, not all C is invalid, statement correct structure E is incorrect, in case multiple rows, error multiple rows in subquery
upvoted 4 times
HassanMkhlalati
1 year, 4 months ago
Incorrect
upvoted 1 times
...
GENO123
1 year, 6 months ago
definitely agree. Oracle will only update the rows that are matched
upvoted 1 times
TofOra
11 months, 2 weeks ago
No, it will update unmatched rows with NULL
upvoted 2 times
...
...
hmatinnn
1 year, 1 month ago
Actually i though in that way. But most likely customer table is PK. Orders table is FK. So it means the data that in the orders table also have in the customers table. And all rows will be updated.
upvoted 1 times
...
...
NB196
1 year, 7 months ago
Can someone explain why A is correct?
upvoted 1 times
raduM
1 year, 6 months ago
because it updates every row. If it does not have a match it will put the value null
upvoted 4 times
...
hmatinnn
1 year, 1 month ago
most likely customer table is PK. Orders table is FK. So it means the data that in the orders table also have in the customers table. And all rows will be updated.
upvoted 1 times
...
...
CyberP
1 year, 7 months ago
I think B is correct, subquery will execute for each row its right but also update will update for each raw after fulfilling the condition of subquery :) Then how update will update each raw ? update will check its resources "subquery" is condition met ? yes ? then update after execute subquery and fully checking it.
upvoted 1 times
TofOra
11 months, 2 weeks ago
The STATMENT update will execute first, then the action of updating will execute after the subquery. explain plan for update ordersQ8 o set customer_name = (select cust_last_name from customersQ8 where customer_id = o.customer_id); SELECT plan_table_output FROM TABLE(DBMS_XPLAN.DISPLAY('plan_table',null,'basic +note'));
upvoted 2 times
...
...
Rik92
1 year, 8 months ago
Selected Answer: AD
AD are correct
upvoted 2 times
...
kuff
1 year, 8 months ago
Selected Answer: AD
AD is the answer
upvoted 1 times
...
kaplanek
1 year, 8 months ago
Selected Answer: AD
A nd D are correct
upvoted 2 times
...
alic_alex
1 year, 10 months ago
Selected Answer: AD
E - wrong because will cause an error "ORA-01427: Subquery returns more than one row"
upvoted 3 times
...
Makub
1 year, 10 months ago
Selected Answer: AE
A and E are correct answers
upvoted 2 times
...
subtype11
1 year, 11 months ago
Answer: A and D are correct. B is not correct because the subquery is executed for each row in the ORDERS table, not before the update statement is executed. C is not correct because the subquery is a correlated subquery, not a non-correlated subquery. E is not correct because if the subquery selects multiple rows, the update statement will fail with a "subquery returns more than one row" error.
upvoted 3 times
TheOracleWasTaken
1 year, 5 months ago
how is B not correct, isn't it obviously gonna run the subquery before it updates the row?
upvoted 2 times
...
CyberP
1 year, 7 months ago
I think B is correct, as you said subquery will execute for each row its right but also update will update for each raw after fulfilling the condition of subquery :) Then how update will update each raw ? update will check its resources "subquery" is condition met ? yes ? then update after execute subquery and fully checking it.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago