1501. Bulk insert — E-commerce — implementation variant 1

DBMS Published Updated 0 Views Verified
In a E-commerce application, implement this production problem: Insert multiple records efficiently in one request. The API/service receives user input and must return or modify data safely. Give the SQL solution, explain why it works, and show how the same operation is called from the selected stack.
Looking for the latest Sarkari Result 2026 updates? Check the latest government exam results, merit lists and result updates on Sarkari Resultess.
Sarkari Resultess
Questions & Answers

Answer & Explanation

4 Answers
Verified

Option A

UPDATE the_table SET status='active';
Additional Explanation
Incorrect: it does not implement the stated business rule and may modify/fetch the wrong rows.
Sarkari Resultess
Editorial Answer 1
Verified Correct Answer

Option B

INSERT INTO products(name,price,stock) VALUES (:name1,:price1,:stock1),(:name2,:price2,:stock2),(:name3,:price3,:stock3);
Additional Explanation
Batching reduces round trips compared with issuing one INSERT per row, but batch size should be bounded.
Sarkari Resultess
Editorial Answer 2
Verified

Option C

DELETE FROM the_table;
Additional Explanation
Incorrect: it does not implement the stated business rule and may modify/fetch the wrong rows.
Sarkari Resultess
Editorial Answer 3
Verified

Option D

SELECT * FROM the_table;
Additional Explanation
Incorrect: it does not implement the stated business rule and may modify/fetch the wrong rows.
Sarkari Resultess
Editorial Answer 4