UNIT 6 Flashcards
a procedural SQL code that is automatically invoked by the RDBMS upon the occurrence of a given data manipulation event.
Trigger
A TRIGGER is created using the __________ command.
CREATE TRIGGER
It cannot be created on a view, temporary table or system table, but they can reference views or temporary tables
trigger
To delete or remove a trigger we use what command
DROP TRIGGER trigger_name
replaces the existing line ender (;) with the provided symbol. Used for END statement.
Delimiter
Delimiter is used in what kind of statement
End statement
is used if we want to execute the trigger before changes are made to the table. Meaning it will be executed regardless of a successful operation.
BEFORE
is used if we want to execute the trigger before changes are made to the table.
AFTER
trigger is used for insert operation
INSERT
trigger is used for update operation
UPDATE
trigger is used for delete operation
DELETE
indicates that the trigger will be in effect for all the row changes made inside the table
FOR EACH ROW
What are the 2 types of triggers
Data Manipulation Language (DML) trigger
and
Data Definition Language (DDL) trigger
Executes when INSERT, UPDATE, and DELETE commands modify data in a table or view.
Data Manipulation Language (DML) trigger
Executes in response to a DDL statement that is often used to make database schema changes. Examples include the CREATE, ALTER, and DROP statements.
Data Definition Language (DDL) trigger