The Wayback Machine - https://web.archive.org/web/20240204103352/https://www.geeksforgeeks.org/difference-between-row-level-and-statement-level-triggers/
Open In App
Related Articles

Difference between Row level and Statement level triggers

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

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 STATEMENT” 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.

Unlock the Power of Placement Preparation!
Feeling lost in OS, DBMS, CN, SQL, and DSA chaos? Our Complete Interview Preparation Course is the ultimate guide to conquer placements. Trusted by over 100,000+ geeks, this course is your roadmap to interview triumph.
Ready to dive in? Explore our Free Demo Content and join our Complete Interview Preparation course.


Last Updated : 18 Feb, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads