trigger TriggerName on ObjectName (trigger_events) {
code_block
}
For example, the following code defines a trigger for the before insert and before update events on the Account object:
trigger myAccountTrigger on Account (before insert, before update) { // Your code here }
The code block of a trigger cannot contain the static keyword. Triggers can only contain keywords applicable to an inner class. In addition, you do not have to manually commit any database changes made by a trigger. If your Apex trigger completes successfully, any database changes are automatically committed. If your Apex trigger does not complete successfully, any changes made to the database are rolled back.