Vidyalelo
MySQL · Q914

MySQL

Programming · MySQL · question 914

Q914

What is def in the following MySQL statement? CREATE TRIGGER abc (...) (...) ON def FOR EACH ROW ghi;

A.
trigger name
B.
table name
Answer
C.
trigger statement
D.
update statement

Answer: Option B

Solution

Answer: Option B
Solution:
This question is about understanding the parts of a MySQL trigger statement. Triggers are like special instructions that run automatically when something happens to a table. Let's break down the code:

`CREATE TRIGGER abc (...) (...) ON def FOR EACH ROW ghi;`

- `CREATE TRIGGER`: This tells MySQL you're creating a new trigger.
- `abc`: This is the name you've given your trigger.
- `(...) (...)`: These are placeholders for the trigger conditions (when it should run) and the trigger actions (what it should do).
- `ON def`: This is the important part! This tells MySQL which table the trigger should watch. So, `def` is the table name.
- `FOR EACH ROW ghi`: This part describes what the trigger should do for each row that is affected by the trigger conditions.

Therefore, the correct answer is Option B: table name.