The number of rows affected by the REPLACE query indicates,

the number of matching rows removed in the table

the number of matching rows replaced in the table

the number of new rows inserted into the table

the number of matching rows deleted from the table and the number of new/replacing rows inserted into the table

Verified Answer
Correct Option - d
Anush said

The correct answer is: the number of matching rows deleted from the table and the number of new/replacing rows inserted into the table

When you use a REPLACE query, it's like a "swap" operation. It removes the matching rows from the table and inserts new rows (which can be updated or entirely new ones) in their place. So, the number of rows affected shows both the removal and insertion counts.

Here's a breakdown:

  • Matching rows removed (deleted): The old data that's replaced
  • New/Replacing rows inserted: The new data that's added

So, the rows affected count gives you the total of both these actions!

To get all Infosys Certified MySQL Associate Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in