PLSQL: TRIGGERES - BEFORE, AFTER, ROW LEVEL, STATEMENT LEVEL, CONDITIONAL TRIGGERS
30 programming challenges to help you master the fundamentals of DATABASE MANAGEMENT SYSTEM USING ORACLE.
Write a trigger to display a message whenever a record is inserted into EMP table.
(Trigger Basics)
Write a trigger that fires before inserting data into EMP table.
(BEFORE INSERT Trigger)
Write a trigger that fires after deleting a record from EMP table.
(AFTER DELETE Trigger)
Write a trigger to display a message when employee salary is updated.
(AFTER UPDATE Trigger)
Write a row-level trigger to display old and new salary when salary is updated.
(:OLD and :NEW)
Write a trigger to restrict salary update if new salary is less than old salary.
(Row-Level Trigger + Validation)
Write a trigger to automatically set hiredate while inserting employee record.
(BEFORE INSERT + :NEW)
Write a trigger to copy deleted records into another table (audit table).
(AFTER DELETE + Logging)
Write a statement-level trigger to display message when any insert occurs on EMP table.
(Statement-Level Trigger)
Write a statement-level trigger to log update operations on EMP table.
(Logging Trigger)
Write a trigger that fires once for DELETE statement regardless of number of rows.
(Statement-Level Trigger)
Write a trigger to log user activity (who updated, when updated).
(Audit + USER, SYSDATE)