Triggers are defined as stored programs which are automatically executed whenever some events such as CREATE, ALTER, UPDATE, INSERT, DELETE takes place.They can be defined on a database, table, view with which event is associated.
Triggers can be broadly classified into Row Level and Statement Level triggers.
Broadly, these can be differentiated as:
|Row Level Triggers||Statement Level Triggers|
|Row level triggers executes once for each and every row in the transaction.||Statement level triggers executes only once for each single transaction.|
|Specifically used for data auditing purpose.||Used for enforcing all additional security on the transactions performed on the table.|
|“FOR EACH ROW” clause is present in CREATE TRIGGER command.||“FOR EACH ROW” clause is omitted in CREATE TRIGGER command.|
|Example: If 1500 rows are to be inserted into a table, the row level trigger would execute 1500 times.||Example: If 1500 rows are to be inserted into a table, the statement level trigger would execute only once.|
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Difference between High Level and Low level languages
- Difference between User Level thread and Kernel Level thread
- DBMS Architecture 2-Level, 3-Level
- Difference between Process and User Level Thread
- Difference between Multi Level Queue Scheduling (MLQ) and Shortest Job First
- Difference between Multi Level Queue Scheduling (MLQ) and First Come First Served (FCFS)
- Difference between Multi Level Queue (MLQ) Scheduling and Round Robin (RR) algorithms
- Difference Between High-level Data Link Control (HDLC) and Point-to-Point Protocol (PPP)
- Display Sequence of Numbers in SQL Using LEVEL
- SQL | Triggers
- Different types of MySQL Triggers (with examples)
- SQL | DESCRIBE Statement
- SQL | MERGE Statement
- Join statement in JCL
- SELECT INTO statement in SQL
- SQL | DELETE Statement
- SQL | UPDATE Statement
- SQL | INSERT INTO Statement
- SQL | Case Statement
- Insert statement in MS SQL Server
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.