233k views
5 votes
Which command will return a list of triggers in the current database?

a) SHOW TRIGGERS;
b) DESCRIBE TRIGGERS;
c) LIST TRIGGERS;
d) SELECT * FROM INFORMATION_SCHEMA.TRIGGERS;

User GoonGamja
by
8.9k points

1 Answer

0 votes

Final answer:

To list triggers in the current database, the correct command is 'SHOW TRIGGERS;'. For detailed trigger information, use 'SELECT * FROM INFORMATION_SCHEMA.TRIGGERS;'.

Step-by-step explanation:

To retrieve a list of triggers in the current database, the correct command is:
SHOW TRIGGERS;

Using SHOW TRIGGERS, you can see all triggers associated with tables within the current database. This command will display information such as the trigger name, the event that activates it (such as INSERT, UPDATE, or DELETE), the table associated with the trigger, and the timing of the trigger (BEFORE or AFTER the event).

If you would like to retrieve detailed information about the triggers, including their definition, you can use the following command:
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS;

This command pulls detailed data from the INFORMATION_SCHEMA, which is a database that holds metadata about other databases.

User Evelin Amorim
by
7.6k points