Here it is important to note that even if the UPDATE command didn’t affect any rows, the code within the trigger will still be executed once.
Using the BEFORE and AFTER options determine when the trigger is called.
When using these options you need to keep a few things in mind.
Statement level triggers will be called once regardless of how many rows are affected by the UPDATE.
The code within the trigger is executed after the INSERT happens to the table.
An example use of this trigger is creating an audit history of who has made inserts into the database, keeping track of the changes made.
An example of implementation of triggers in non-relational database can be Sedna, that provides support for triggers based on XQuery.
Triggers in Sedna were designed to be analogous to SQL:2003 triggers, but natively base on XML query and update languages (XPath, XQuery and XML update language).