958. Procedure with OUT parameter — implementation 4

DBMS Published Updated 0 Views Verified
Write the MySQL stored routine implementation for this backend/database task. Include validation where appropriate.
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

Commit unrelated application work inside every function.
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 1
Verified

Option B

Use a trigger when an explicit callable procedure/function is requested.
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 2
Verified

Option C

Use only a SELECT and ignore the requested routine.
Additional Explanation
This option is incorrect for the stated requirement.
Sarkari Resultess
Editorial Answer 3
Verified Correct Answer

Option D

DELIMITER // CREATE PROCEDURE get_order_count(IN p_customer_id BIGINT, OUT p_count INT) BEGIN SELECT COUNT(*) INTO p_count FROM orders WHERE customer_id=p_customer_id; END // DELIMITER ;
Additional Explanation
Correct implementation. Prefer parameterized queries in application code, validate affected rows for UPDATE/DELETE, and use transactions for related writes.
Sarkari Resultess
Editorial Answer 4