Core Concept Mastery • DBMS Module
Think of a Motion Sensor Light.
You don't have to flip the switch.
The moment you walk into the room (Event: INSERT/UPDATE), the light turns on automatically (Action).
In a database:
The moment someone changes a Salary (Event), the Trigger wakes up and writes an entry in the Audit Log (Action). "Hey, User X changed the salary!".
It happens behind the scenes, instantly.
Great for automation! You don't want to trust users to remember to log changes. The database does it for you in the background.
If someone deletes a "Student", the Trigger automatically copies their file to a "Deleted Students Archive" for safety.
"A special kind of stored procedure that executes automatically is?"
Trigger.