0
0
MySQLquery~5 mins

Procedure parameters (IN, OUT, INOUT) in MySQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the IN parameter type mean in a MySQL stored procedure?
IN parameters are used to pass values into the procedure. They are read-only inside the procedure and cannot be changed.
Click to reveal answer
beginner
What is the purpose of an OUT parameter in a MySQL stored procedure?
OUT parameters are used to return values from the procedure back to the caller. They can be assigned new values inside the procedure.
Click to reveal answer
intermediate
Explain the INOUT parameter type in MySQL stored procedures.
INOUT parameters allow passing a value into the procedure and also returning a modified value back to the caller. They can be read and changed inside the procedure.
Click to reveal answer
beginner
How do you declare an OUT parameter in a MySQL stored procedure?
You declare it by specifying OUT before the parameter name and its data type, for example: OUT param_name INT.
Click to reveal answer
beginner
Can IN parameters be modified inside a MySQL stored procedure?
No, IN parameters are read-only inside the procedure and cannot be changed.
Click to reveal answer
Which parameter type allows you to pass a value into a MySQL procedure and get a modified value back?
AIN
BINOUT
CRETURN
DOUT
What happens if you try to change an IN parameter inside a MySQL procedure?
AThe value changes and is returned
BAn error occurs
CThe change is ignored; IN parameters are read-only
DThe procedure stops running
How do you specify an OUT parameter in a MySQL procedure declaration?
ABy writing IN before the parameter name
BBy writing RETURN before the parameter name
CBy writing INOUT before the parameter name
DBy writing OUT before the parameter name
Which parameter type cannot return a value back to the caller?
AIN
BOUT
CINOUT
DALL can return values
If you want to get a result from a procedure using parameters, which type should you use?
AOUT
BIN
CINOUT
DNone, use SELECT only
Describe the differences between IN, OUT, and INOUT parameters in MySQL stored procedures.
Think about how data flows between caller and procedure.
You got /3 concepts.
    How would you use an OUT parameter to get a value from a MySQL stored procedure?
    Consider the steps to send data back from procedure to caller.
    You got /3 concepts.