What is trigger in SQL
A trigger is an advanced SQL concept. Triggers are user-defined SQL command that is invoked automatically in response to an event such as insert, delete or update.
on table_name for each row
*Trigger time: before or after,
*Trigger event: insert delete or update
I will create a table of three columns name, age, enrollment date.
The trigger here consists of assigning 0 to age with a negative value.
Result without trigger:
Result with trigger: