COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
A DML statement(insert or update or delete)
|
|
A DDL statement
|
|
A database operation(startup, shutdown)
|
|
All of the above
|
Detailed explanation-1: -Triggers are written to be executed in response to any of the following events. A database manipulation (DML) statement (DELETE, INSERT, or UPDATE). A database definition (DDL) statement (CREATE, ALTER, or DROP). A database operation (SERVERERROR, LOGON, LOGOFF, STARTUP, or SHUTDOWN).
Detailed explanation-2: -The events which fire a trigger can be DML statements that modify data in a table (INSERT, UPDATE, or DELETE), DDL statements, system events such as startup, shutdown, and error messages, or user events such as logon and logoff.
Detailed explanation-3: -A trigger is a database object that automatically executes one or more SQL statements (the triggered action) when a specified data manipulation language operation (the triggering event) occurs. You can define one or more triggers on a table to execute after a SELECT, INSERT, UPDATE or DELETE triggering event.