MySQL Stored Procedure MCQs with answers Page - 2

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.03K Points
Coach

Q. Which statement is used to return from a stored procedure?

  • (A) EXIT
  • (B) STOP
  • (C) RETURN
  • (D) END

A

Admin • 828.03K Points
Coach

Q. Can a stored procedure call another stored procedure in MySQL?

  • (A) Yes
  • (B) No
  • (C) Only if both are in the same schema
  • (D) Only if they don’t have parameters

A

Admin • 828.03K Points
Coach

Q. Which privilege is required to create a stored procedure?

  • (A) CREATE FUNCTION
  • (B) CREATE ROUTINE
  • (C) EXECUTE
  • (D) INSERT

A

Admin • 828.03K Points
Coach

Q. Which privilege is required to execute a stored procedure?

  • (A) EXECUTE
  • (B) RUN
  • (C) CALL
  • (D) PROCEDURE

A

Admin • 828.03K Points
Coach

Q. Can stored procedures improve performance?

  • (A) Yes, because they are precompiled
  • (B) No, they are slower than queries
  • (C) Only for SELECT queries
  • (D) Only in replication

A

Admin • 828.03K Points
Coach

Q. Which of the following can be used inside a stored procedure?

  • (A) Variables
  • (B) Cursors
  • (C) Handlers
  • (D) All of the above

A

Admin • 828.03K Points
Coach

Q. Which statement is used to declare a variable inside a stored procedure?

  • (A) DECLARE var_name datatype
  • (B) SET var_name datatype
  • (C) LET var_name datatype
  • (D) VAR var_name datatype

A

Admin • 828.03K Points
Coach

Q. What is the difference between stored procedures and functions in MySQL?

  • (A) Procedures must return a value, functions may not
  • (B) Functions must return a value, procedures may not
  • (C) Both must return values
  • (D) Neither can return values

A

Admin • 828.03K Points
Coach

Q. Which of the following is NOT an advantage of stored procedures?

  • (A) Improved performance
  • (B) Centralized logic
  • (C) Reduced network traffic
  • (D) Automatic query optimization

A

Admin • 828.03K Points
Coach

Q. Which keyword is used to declare a cursor in a stored procedure?

  • (A) CURSOR
  • (B) DECLARE
  • (C) OPEN
  • (D) FETCH
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