Oracle PL/SQL Trigger: A Comprehensive Guide
PL/SQL Trigger [ 11 exercises with solution ]
1. Write a code in PL/SQL TO create a trigger that automatically updates a 'last_modified' timestamp whenever a row in a specific table is updated.
2. Write a code in PL/SQL to create a trigger that prevents updates on a certain column during specific hours of the day.
3. Write a code in PL/SQL to implement a trigger that maintains a transaction history log whenever a row is deleted from a table.
4. Write a code in PL/SQL to develop a trigger that enforces referential integrity by preventing the deletion of a parent record if child records exist.
5. Write a code in PL/SQL to create a trigger that checks for duplicate values in a specific column and raises an exception if found.
6. Write a code in PL/SQL to create a trigger that restricts the insertion of new rows if the total of a column's values exceeds a certain threshold.
7. Write a code in PL/SQL to design a trigger that captures changes made to specific columns and logs them in an audit table.
8. Write a code in PL/SQL to implement a trigger that records user activity (inserts, updates, deletes) in an audit log for a given set of tables.
9. Write a code in PL/SQL to implement a trigger that automatically calculates and updates a running total column for a table whenever new rows are inserted.
10. Write a code in PL/SQL to create a trigger that validates the availability of items before allowing an order to be placed, considering stock levels and pending orders.
11. Design a trigger that sends an email notification to a predefined address whenever an error occurs during a specific operation.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/plsql-exercises/trigger/index.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics