Problem Statement
What is the safest pattern to update or delete rows in production?
Explanation
Preview the effect with a SELECT using the same predicate. Then run the UPDATE or DELETE.
Consider transactions and backups when touching many rows. Cascades may propagate changes across tables.
Code Solution
SolutionRead Only
-- preview SELECT * FROM orders WHERE status='CANCELLED'; -- then DELETE FROM orders WHERE status='CANCELLED';
