Bird
0
0

Given this procedure:

medium📝 query result Q4 of 15
SQL - Stored Procedures and Functions
Given this procedure:
CREATE PROCEDURE increment_value(INOUT num INT)
BEGIN
SET num = num + 20;
END;

What will be the output after executing:
SET @val = 15;
CALL increment_value(@val);
SELECT @val;
A15
B35
C20
DNULL
Step-by-Step Solution
Solution:
  1. Step 1: Understand INOUT parameter behavior

    INOUT parameters allow passing a variable in and returning a modified value.
  2. Step 2: Analyze procedure logic

    The procedure adds 20 to the input value.
  3. Step 3: Calculate output

    Initial value is 15, after adding 20, value becomes 35.
  4. Final Answer:

    35 -> Option B
  5. Quick Check:

    INOUT modifies variable passed by reference [OK]
Quick Trick: INOUT modifies passed variable value [OK]
Common Mistakes:
  • Assuming INOUT behaves like IN (no change)
  • Expecting output without using session variables
  • Confusing procedure logic with parameter modes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes