Bird
0
0

Consider this procedure:

medium📝 query result Q5 of 15
SQL - Stored Procedures and Functions
Consider this procedure:
CREATE PROCEDURE compute_total(IN x INT, IN y INT, OUT sum_result INT)
BEGIN
SET sum_result = x + y;
END;

What will be the output of:
CALL compute_total(4, 6, @output);
SELECT @output;
ANULL
B46
C10
DError
Step-by-Step Solution
Solution:
  1. Step 1: Understand procedure parameters

    Two IN parameters and one OUT parameter to store sum.
  2. Step 2: Analyze procedure logic

    Sum of 4 and 6 is assigned to sum_result.
  3. Step 3: Check procedure call

    Output variable @output will hold the sum after call.
  4. Final Answer:

    10 -> Option C
  5. Quick Check:

    OUT parameter returns computed value [OK]
Quick Trick: OUT parameter returns computed value [OK]
Common Mistakes:
  • Confusing concatenation with addition
  • Expecting output without using session variables
  • Assuming procedure returns value directly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes