- A trigger is a unit of logic embedded in a database.
- Event driven and triggered when there is an attempt to update the database.
- A trigger is associated with a specific table and activated when insertions, deletions or updates are requested against rows in that table.
Describe The Three Triggers of Different Database Functions.
• Validating input data. For instance, in terms of an academic database we might use a trigger to check that a lecturer teaches no more than eight modules in an academic session
• Use as alerters. Hence, a trigger might be used to flag to school administrators when a particular module is full.
• Maintaining audit information for database administrators. Triggers might be used by a DBA to record information about updates made to a particular table in the database
• Supporting distribution actions. A trigger may be used to automatically update a desktop system with information from the central student information system at regular intervals
Explain what a stored procedure is.
- A stored procedure is an autonomous unit of logic embedded in a database.
- It may be called from another stored procedure or a trigger.
- It may be called by an external application.