DEFINE TRIGGERS | WHAT IS MEANT BY TRIGGER IN DBMS - Anna University Multiple Choice Questions

DEFINE TRIGGERS | WHAT IS MEANT BY TRIGGER IN DBMS

Triggers:

A Trigger defines an action that the database should take when some database related event occurs.The execution of triggers is transparent to the users.A trigger may cause another trigger to be invoked.A mutating trigger is a trigger that triggers itself.

Types Of Triggers:

The triggers types are defined by the type of triggering transactions and by the level at which the trigger is executed.
  • Row-level triggers
  • Statement-level triggers
  • Before and after triggers
Row-level triggers:
Row-level triggers,trigger once for each row in a transaction.This trigger can be created by using the for each row clause trigger comment.
Statement-level triggers:
Statement-level triggers execute once in a transaction.It can be created by using create trigger comment.It is one of the default type of triggers.
Before and after triggers:
Since the events that executes triggers are database transactions,triggers can be executed immediatly before or after INSERT,UPDATE and DELETE comments.

Purpose of Triggers:
  • To generate data automatically
  • To enforce complex integrity constrains
  • To customize complex security authorizations
  • To maintain replicate tables
  • To audit data modifications

No comments:

Post a Comment