Difficulty: Easy
Correct Answer: Incorrect
Explanation:
Introduction / Context:
Triggers are a core database feature used to enforce rules, log changes, or maintain derived data. A common misunderstanding is that triggers are like stored procedures that you must call directly. In reality, triggers are bound to table or view events and execute automatically when those events occur.
Given Data / Assumptions:
Concept / Approach:
A trigger is a declarative hook: once created, it fires automatically before or after the specified DML event on the target object. Unlike procedures or functions, which are invoked via CALL or SELECT, a trigger runs because the triggering event happened, not because a user explicitly invoked it. This makes triggers suitable for auditing, enforcing complex constraints, and propagating changes.
Step-by-Step Solution:
Verification / Alternative check:
Temporarily disable the trigger; perform the DML; note that its logic no longer runs—confirming that the engine, not user code, invokes it in response to events.
Why Other Options Are Wrong:
Common Pitfalls:
Doing business logic exclusively in triggers leading to opaque side effects; creating recursive trigger behavior.
Final Answer:
Incorrect
Discussion & Comments