Access Control for MySQL Stored Programs and Views


  1. How many of the following can be used in stored functions?
    PREPARE, EXECUTE, DEALLOCATE PREPARE











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    In MySQL, the SQL prepared statements: PREPARE, EXECUTE and DEALLOCATE PREPARE can be used in the stored procedures. They cannot be stored in the stored functions or triggers.


  1. How many of the following can be used in stored procedures?
    PREPARE, EXECUTE, DEALLOCATE PREPARE











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The SQL prepared statements, PREPARE, EXECUTE, DEALLOCATE PREPARE can be used in the stored procedures. They can however, not be stored in the stored functions or triggers.



  1. The locking statements LOCK TABLES and UNLOCK TABLES are not permitted in stored routines.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In MySQL, the stored routines cannot contain arbitrary SQL statements. For example, the locking statements LOCK TABLES and UNLOCK TABLES are not permitted in the stored routines.


  1. Which privilege is enabled to create of alter a stored function?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In order to create or alter a stored function, the SUPER privilege should be given in addition to the CREATE ROUTINE privilege that is normally required. Depending on the DEFINER value in the function definition SUPER might be required.



  1. What produces result sets?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In MySQL, views are the stored queries that when referenced produce a result set. A view acts as a virtual table. A stored procedure is also a component that can return result sets.