Triggers in MySQL automatically execute SQL code in response to specific table events, such as INSERT, UPDATE, or DELETE operations. They help enforce business rules, maintain audit logs, and automate data modifications. This quiz will test your understanding of MySQL triggers, including their syntax, use cases, and best practices. Get ready to assess your knowledge of how triggers work and how to implement them effectively!
1.
Which statement is NOT allowed inside a MySQL trigger?
2.
Which of the following statements best describes an AFTER DELETE trigger?
3.
Which events can activate a MySQL trigger?
4.
Which of the following best describes the relationship between triggers and transactions?
5.
Which statement is used to create a trigger in MySQL?
6.
What is the purpose of the SIGNAL SQLSTATE statement inside a trigger?
7.
How can you modify an existing trigger in MySQL?
8.
Which keyword is used to reference the old row values in a trigger?
9.
Which keyword is used to reference the new row values in a trigger?
10.
How many triggers can be created per table per event in MySQL?
11.
How can you view all triggers in a database?
12.
Which SQL statement is used to remove a trigger?
13.
What clause determines whether a trigger executes before or after an event?
14.
What happens if a trigger causes an error during execution?
15.
What is a common use case for a BEFORE INSERT trigger?
16.
Which of the following is a valid use case for a MySQL trigger?
18.
Which of the following limitations apply to MySQL triggers?
19.
Which statement is true about MySQL triggers?