SQL - TriggersWhich of the following is a valid reason to use a DELETE trigger in a database?ATo automatically log deleted rows for auditingBTo speed up the deletion processCTo prevent any rows from being deletedDTo create new rows when a delete happensCheck Answer
Step-by-Step SolutionSolution:Step 1: Identify common uses of DELETE triggersDELETE triggers often log deletions or maintain related data.Step 2: Evaluate optionsLogging deleted rows is a common and valid use; speeding deletion or preventing all deletes is not typical.Final Answer:To automatically log deleted rows for auditing -> Option AQuick Check:DELETE trigger use = logging deletions [OK]Quick Trick: Use DELETE triggers to log or audit deletions [OK]Common Mistakes:Thinking triggers speed up deletesAssuming triggers block all deletesConfusing DELETE triggers with INSERT triggers
Master "Triggers" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Common Table Expressions (CTEs) - CTE referencing another CTE - Quiz 12easy Database Design and Normalization - Denormalization and when to use it - Quiz 3easy Indexes and Query Performance - Why indexes matter - Quiz 3easy Indexes and Query Performance - EXPLAIN plan for query analysis - Quiz 3easy Stored Procedures and Functions - CURSOR concept and usage - Quiz 15hard Stored Procedures and Functions - CREATE PROCEDURE syntax - Quiz 6medium Stored Procedures and Functions - Why stored procedures are needed - Quiz 2easy Transactions and Data Integrity - COMMIT and ROLLBACK behavior - Quiz 11easy Transactions and Data Integrity - Auto-commit behavior - Quiz 6medium Window Functions Fundamentals - OVER clause with PARTITION BY - Quiz 8hard