Machine-translated by Google. Questions are authored in English.
Top

Discussion

On which of the following, the events in a trigger can be fired ?

(i) Select
(ii) Update
(iii) Delete
(iv) Insert

  • A.(i), (ii) and (iii)
  • B.(ii) and (iii)
  • C.(ii), (iii) and (iv)
  • D.(i), (ii), (iii) and (iv)

Answer: C

Trigger events are (ii), (iii) and (iv), so the answer is (ii), (iii) and (iv).

A DML trigger is fired by a statement that changes data in its table: an INSERT, an UPDATE or a DELETE. It can run before or after the change, once per statement or once per affected row, for example to keep an audit log or enforce a rule the constraints cannot express.

A SELECT reads data without changing it, so in standard SQL and in the major database systems it does not fire a trigger. Options that include (i) are therefore wrong, and the option naming only update and delete leaves out insert.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.