Which of the following statements about triggers are TRUE? (Choose two.)
Which of the following statements about triggers are TRUE? (Choose two.)
Triggers can be activated as a result of changes due to referential constraint enforcement. This means that the enforcement of referential constraints can cause triggers to be fired. Additionally, constraints associated with a subject table are applied between the execution of BEFORE and AFTER triggers. BEFORE triggers allow modifications to the values being inserted or updated before the actual database data is changed, while AFTER triggers are used for actions that need to occur after the data modification, such as maintaining data relationships or audit trails.
The answer B is correct because you can use triggers, along with referential constraints and CHECK constraints, to enforce data integrity rule. The answer D is correct because : - BEFORE triggers are activated before an update or INSERT operation, and the values that are being updated or inserted can be changed before the database data is modified in the table. - AFTER triggers are activated after an INSERT, UPDATE, or DELETE operation and are used to maintain relationships between data or to keep audit trail information.
The answer E is wrong because the activation of a trigger results in the running of its associated triggered action. Every trigger has exactly one triggered action which, in turn, has two components: an optional triggered action condition or WHEN clause, and a set of triggered statement(s). Reference : https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.dbobj.doc/doc/t0020231.html
The answer A is wrong. YOur maximum is 16. The maximum nesting level for triggers is 16. That is, the maximum number of cascading trigger activations is 16. A trigger activation refers to the activation of a trigger upon a triggering event, such as insert, update, or delete of data in a column of a table, or generally to a table. (reference https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.dbobj.doc/doc/t0020227.html)
The answer C is wrong because only one INSTEAD OF trigger is allowed for each kind of operation on a given subject view (SQLSTATE 428FP).