Create database triggers for automated data operations
Create a database trigger for this requirement:
**Trigger Purpose:** {{TRIGGER_PURPOSE}}
**Target Table:** {{TARGET_TABLE}}
**Trigger Timing:** {{TIMING}} (BEFORE/AFTER)
**Trigger Event:** {{EVENT}} (INSERT/UPDATE/DELETE)
**Business Logic:** {{BUSINESS_LOGIC}}
**Database System:** {{DATABASE_SYSTEM}}
Please provide:
1. Complete trigger code with:
- Proper syntax for the database system
- NEW/OLD row handling
- Conditional logic
- Error handling
2. Audit trail implementation if needed
3. Performance impact analysis
4. Testing strategy
5. Debugging tips
6. Common pitfalls to avoid
7. Alternative approaches (application-level vs. database-level)Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{TRIGGER_PURPOSE][{TARGET_TABLE][{TIMING][{EVENT][{BUSINESS_LOGIC][{DATABASE_SYSTEM]