MySQL Stored Procedure MCQs with answers Page - 6

You will find multiple-choice questions (MCQs) related to #MySQL Stored Procedure here. Go through these questions to prepare effectively for your upcoming exams and interviews.

To view the correct answer for any question, simply click the "Show Answer" button.

Have a question to share? Click on "Add Question" to contribute!

A

Admin • 828.70K Points
Coach

Q. What is the difference between INOUT and OUT parameters?

  • (A) INOUT can accept input and return output, OUT only returns output
  • (B) INOUT only accepts input, OUT only returns output
  • (C) INOUT only returns output, OUT only accepts input
  • (D) No difference

A

Admin • 828.70K Points
Coach

Q. Can stored procedures execute dynamic SQL in MySQL?

  • (A) Yes, using PREPARE and EXECUTE
  • (B) No, only functions can execute dynamic SQL
  • (C) Yes, using CALL statement
  • (D) No, MySQL does not allow dynamic SQL

A

Admin • 828.70K Points
Coach

Q. Which of the following is TRUE about transaction handling in stored procedures?

  • (A) Procedures can use START TRANSACTION, COMMIT, and ROLLBACK
  • (B) Procedures cannot manage transactions
  • (C) Procedures only commit automatically
  • (D) Procedures cannot rollback changes

A

Admin • 828.70K Points
Coach

Q. Which system table stores stored procedure definitions in MySQL?

  • (A) mysql.routines
  • (B) information_schema.procedures
  • (C) mysql.procedures
  • (D) information_schema.routines

A

Admin • 828.70K Points
Coach

Q. Which type of handler allows continuing procedure execution after an error occurs?

  • (A) EXIT
  • (B) CONTINUE
  • (C) IGNORE
  • (D) STOP

A

Admin • 828.70K Points
Coach

Q. Can stored procedures return multiple result sets in MySQL?

  • (A) Yes, by using multiple SELECT statements
  • (B) No, only one result set is allowed
  • (C) Yes, but only with OUT parameters
  • (D) No, only functions return multiple results

A

Admin • 828.70K Points
Coach

Q. Which statement is used to declare a condition handler for a specific SQLSTATE code?

  • (A) DECLARE CONTINUE HANDLER FOR SQLSTATE 'code'
  • (B) DECLARE EXIT HANDLER ON ERROR
  • (C) HANDLER SQLSTATE 'code'
  • (D) SET HANDLER SQLSTATE 'code'

A

Admin • 828.70K Points
Coach

Q. Which statement inside a stored procedure ensures safe cleanup of cursors after use?

  • (A) CLOSE cursor_name
  • (B) DEALLOCATE cursor_name
  • (C) DROP cursor_name
  • (D) END cursor_name
What's Tag

As you may know, questions are organized under broad categories. Each category can include various types of questions. For example, the "History" category might contain questions about the Revolt of 1857, Shivaji Maharaj, Ancient History, Buddhism, and more.

To further refine this organization, we've introduced tags, which act as sub-categories to group questions more specifically.

Verified users can add tags to any question. If you have any suggestions regarding this system, we'd love to hear from you. Contact Us

Learn More