What are SQL triggers and how are they used?
What will be an ideal response?
An SQL trigger is a stored program that is attached to a table or view. The trigger is invoked by the DBMS whenever an insert, update or delete request is made on the table or view with the trigger. There are three commonly used triggers: BEFORE, INSTEAD OF, and AFTER (MS SQL server does not support BEFORE). This creates a set of nine possible trigger types: BEFORE + [INSERT or UPDATE or DELETE], INSTEAD OF + [INSERT or UPDATE or DELETE], and AFTER + [INSERT or UPDATE or DELETE]. Triggers are used (among other things) for (1 ) providing default values, (2 ) validity checking, (3 ) updating views, and (4 ) enforcing referential integrity actions.
Business