Question:

The CREATE TRIGGER statement is used to create the trigger. THE _________ clause specifies the table name on which the trigger is to be attached. The ___________ pecifies that this is an AFTER INSERT trigger.

Show Hint

- In SQL, ON is used to specify the table for the trigger. - FOR INSERT is used to specify that the trigger activates after an INSERT operation.
Updated On: Feb 6, 2025
  • for insert, on
  • on, for insert
  • for, insert
  • for, for insert
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation


Step 1:
Understanding CREATE TRIGGER Syntax
The syntax of the CREATE TRIGGER statement in SQL is: \[ \texttt{CREATE TRIGGER trigger\_name} \] \[ \texttt{ON table\_name} \] \[ \texttt{FOR INSERT} \] \[ \texttt{AS} \] \[ \texttt{-- trigger body} \] - The ON clause specifies the table on which the trigger is applied.
- The FOR INSERT clause specifies the event that triggers the action.
Step 2:
Evaluating the Options
- (A) Incorrect: The order is wrong. The correct SQL syntax uses `ON` first.
- (B) Correct: `ON` specifies the table, and `FOR INSERT` specifies the event.
- (C) Incorrect: `FOR` does not specify the table; `ON` is required instead.
- (D) Incorrect: `FOR, FOR INSERT` is not a valid SQL syntax.
Was this answer helpful?
0
0