Introduction
A BEFORE trigger runs just before a change happens in the database. It lets you check or change data before saving it.
You want to check if new data meets rules before adding it.
You want to change data automatically before saving it.
You want to stop a change if something is wrong.
You want to log or audit data before it changes.
You want to set default values before inserting data.