Q890
What is defined to execute when the table is modified only?
A.
Stored functions
B.
Stored procedures
C.
Triggers
AnswerD.
Events
Answer: Option C
Solution
Answer: Option C
Solution:
Imagine you have a table of customers in your database. You want to automatically update the customer's "last order date" whenever they place a new order. How can you achieve this? The answer is Triggers.
Triggers are special database objects that automatically execute a set of predefined commands when a specific event happens in a table. In this case, the event would be the modification of the customer table (like adding a new order).
Here's why the other options are incorrect:
* Stored functions and stored procedures are blocks of code that can be called and executed on demand. They don't automatically execute based on table modifications.
* Events are scheduled actions that happen at specific times or intervals. They are not tied to specific table modifications.
So the answer is Option C: Triggers.