Examveda

Which privilege must be given to the database to create a stored function or procedure?

A. CREATE ROUTINE

B. CREATE METHOD

C. CREATE FUNCTION

D. CREATE PROCEDURE

Answer: Option A

Solution (By Examveda Team)

This question asks about the specific privilege required to create stored functions and procedures in MySQL. Stored functions and procedures are like reusable blocks of code that you can call to perform specific tasks within your database.

Let's break down the options:
Option A: CREATE ROUTINE - This is the correct answer. In MySQL, both stored functions and stored procedures are considered "routines." So, the privilege needed to create either one is "CREATE ROUTINE."
Option B: CREATE METHOD - This is not a standard privilege in MySQL.
Option C: CREATE FUNCTION - This is only for creating stored functions, not procedures.
Option D: CREATE PROCEDURE - This is only for creating stored procedures, not functions.
Therefore, the answer is Option A: CREATE ROUTINE.
This privilege allows you to create both stored functions and stored procedures within your database.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous