Examveda

What is defined to execute when the table is modified only?

A. Stored functions

B. Stored procedures

C. Triggers

D. Events

Answer: Option C

Solution (By Examveda Team)

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.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous