Unit 6 Flashcards
a procedural SQL code that is automatically invoked by the RDBMS upon the occurrence of a given data manipulation event
Trigger
To delete or remove a trigger
DROP TRIGGER
A —— is invoked before or after a data row is inserted, updated, or deleted.
trigger
true or false: can a database table may have one or more triggers.
true
replaces the existing line ender (;) with the provided symbol. Used for END statement.
DELIMITER
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
enable you to access columns in the rows affected by a trigger.
the OLD and NEW keywords
2 types of triggers
- Data Manipulation Language (DML) trigger
- 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