Explain about Triggers in SQL

database trigger is procedural code that is automatically executed in response to certain events on a particular table or view in a database. The trigger is mostly used for maintaining the integrity of the information on the database.

The database trigger are executed either before or after our required code. By default it is executed after.

Example:CREATE [OR REPLACE ] TRIGGER trigger_name  
{BEFORE |AFTER |INSTEAD OF}
{INSERT [OR] | UPDATE [OR] |DELETE}
[OF col_name]
on table_name