Multiple choice

Which of the following statements is FALSE regarding triggers?

  1. A trigger can be written for handling updates of a particular column.

  2. A trigger can be run either before or after the execution of an SQL statement.

  3. A trigger cannot be written on a view.

  4. A trigger cannot contains a condition.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

A trigger can be written on a view if it is declared using the 'instead of' keyword. The difference between a normal trigger and an instead of trigger is that when a normal trigger is fired, both the triggers and the firing DML statement like Delete, Insert or Update is also executed. On the other hand, in case of an instead of trigger the DML statements only invoke the trigger, they are not executed. A normal trigger is written against a table whereas an instead of trigger is written on a view.