Stored Procedure MCQs
This section focuses on "Stored Procedure". These Multiple Choice Questions (mcq) should be practiced to improve the SQL/DBMS skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
1. A ___________ is a prepared SQL code that you can save, so the code can be reused over and over again.
A. triggers
B. stored procedure
C. cursor
D. functions
View Answer
Ans : B
Explanation: A stored procedure is a prepared SQL code that you can save, so the code can be reused over and over again.
2. Which statement is used to execute stored procedure?
A. select procedure_name;
B. execute procedure_name;
C. exec procedure_name;
D. procedure call automatically
View Answer
Ans : C
Explanation: exec procedure_name; statement is used to execute stored procedure.
3. Can we pass parameter in stored procedure?
A. We can pass both input and output parameters
B. We can not pass both input and output parameters
C. we can paas input parameter only
D. we can pass output parameter only
View Answer
Ans : A
Explanation: You can also pass both input and output parameters to a stored procedure.
4. Which of the statement is true about stored procedure?
A. Stored procedure can return no values
B. We can not use transactions in stored procedure
C. We can not use stored procedure in select, where statement
D. we can not call function inside stored procedure
View Answer
Ans : C
Explanation: Statement D is true about stored procedure
5. Which of the following is the feature of stored procedure?
A. It enhances efficiency
B. It enhances reusability
C. It enhances security
D. All of the above
View Answer
Ans : D
Explanation: It enhances efficiency, reusability, and security in database management.
6. Which of the following is true abot stored procedure?
A. Stored procedures have better support for error handling
B. Stored procedures can reduce network traffic and latency
C. A single call to a stored procedure can execute many statements
D. All of the above
View Answer
Ans : D
Explanation: All of the above statement are true.
7. Which database operation we can do in stored procedure?
A. Insert
B. Update
C. Delete
D. All of the above
View Answer
Ans : D
Explanation: All the database operation like insert, update and delete can be performed
8. Can we create temporary tables inside stored procedure?
A. Yes
B. No
C. We can create only under certain conditions
D. None of the above
View Answer
Ans : A
Explanation: Yes, we can create temporary tables inside stored procedure
9. Which data type stored procedure can not use?
A. BLOB
B. Stored procedure can use all data types
C. BINARY
D. DOUBLE
View Answer
Ans : B
Explanation: Stored procedure can use all data types
10. Which statement is true about variable tables in stored procedure?
A. Stored procedure can create variable table and can return variable tables
B. Stored procedure can not create variable table and can not return variable tables
C. Stored procedure can create variable table but can not return variable tables
D. Stored procedure can not create variable table but can return variable tables
View Answer
Ans : C
Explanation: Stored procedure can create variable table but can not return variable tables
Discussion