MySQL Stored Procedure MCQs with answers Page - 3

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. Which command is used to open a cursor?

  • (A) FETCH cursor_name
  • (B) OPEN cursor_name
  • (C) DECLARE cursor_name
  • (D) START cursor_name

A

Admin • 828.70K Points
Coach

Q. Which statement is used to retrieve a row from a cursor?

  • (A) GET cursor_name
  • (B) RETRIEVE cursor_name
  • (C) FETCH cursor_name
  • (D) PULL cursor_name

A

Admin • 828.70K Points
Coach

Q. Which statement is used to close a cursor?

  • (A) EXIT cursor_name
  • (B) STOP cursor_name
  • (C) CLOSE cursor_name
  • (D) END cursor_name

A

Admin • 828.70K Points
Coach

Q. Which handler is used to manage errors inside a stored procedure?

  • (A) ERROR HANDLER
  • (B) DECLARE HANDLER
  • (C) EXCEPTION
  • (D) TRY CATCH

A

Admin • 828.70K Points
Coach

Q. What does the CONTINUE handler do in a stored procedure?

  • (A) Stops execution immediately
  • (B) Skips the statement that caused the error and continues
  • (C) Rolls back the transaction
  • (D) Ignores the error silently

A

Admin • 828.70K Points
Coach

Q. Which of the following is NOT a valid handler type?

  • (A) CONTINUE
  • (B) EXIT
  • (C) UNDO
  • (D) All are valid

A

Admin • 828.70K Points
Coach

Q. Which statement is used to roll back a transaction inside a stored procedure?

  • (A) ROLLBACK
  • (B) UNDO
  • (C) CANCEL
  • (D) STOP TRANSACTION

A

Admin • 828.70K Points
Coach

Q. Which statement is used to explicitly start a transaction inside a stored procedure?

  • (A) BEGIN
  • (B) START TRANSACTION
  • (C) NEW TRANSACTION
  • (D) OPEN TRANSACTION

A

Admin • 828.70K Points
Coach

Q. Which command is used to save changes made during a transaction in a stored procedure?

  • (A) COMMIT
  • (B) SAVE
  • (C) APPLY
  • (D) END

A

Admin • 828.70K Points
Coach

Q. What does the SQLSTATE '02000' represent in stored procedures?

  • (A) Syntax error
  • (B) Duplicate entry
  • (C) No data found
  • (D) Access denied
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