MySQL Triggers


  1. Before MySQL 5.1.6 which privilege was required to create and drop triggers?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The privilege to create and drop triggers is version specific in MySQL. Before MySQL 5.1.6, the SUPER privilege was needed. Access control is more correctly handled post this version.


  1. Which statement is used to remove a trigger?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    In order to delete a trigger, the DROP TRIGGER statement is used. The DROP TRIGGER construct is used by writing the phrase ‘DROP TRIGGER’ followed by the scheme name specification.



  1. For which of the following are triggers not supported?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    In MySQL, the triggers are run only after the table modifications like insert, update and delete are run. Triggers are not supported for views. In order to create a trigger, the CREATE TRIGGER statement is used.


  1. Which statement is used to create a trigger?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In order to create a trigger, the CREATE TRIGGER statement is used. The definition indicates the particular type of statement for which the trigger activates and whether it activates before or after the rows are modified.



  1. Triggers enable to enforce data integrity constraints.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In MySQL, a trigger can examine or change new data values to be inserted or used to update a row in a table. This enables the enforcement of the data integrity constraints.