What are triggers and mention its types? What is the use of triggers?
Shathana. S.R. Answered question May 30, 2023
Trigger:
- A trigger defines a set of actions that are performed in response to an insert, update, or delete operation on a specified table.
- When such an SQL operation is executed, the trigger is said to have been activated. Triggers are optional and are defined using the CREATE TRIGGER statement.
Types:
- INSERT
- UPDATE
- DELETE.
Uses:
- The main purpose of triggers is to automate execution of code when an event occurs.
- In other words, if you need a certain piece of code to always be executed in response to an event, the best option is to use triggers.
Shathana. S.R. Answered question May 30, 2023
