Something I learned early on when writing possible dangerous SQL selects:
CREATE TABLE mytable_backup AS SELECT * FROM mytable;
SELECT * FROM mytable WHERE condition;
DELETE FROM mytable WHERE condition;
Or just let the DB work for you with BEGIN; + (select/update/delete) + COMMIT; or ROLLBACK;
What I like about SQL is that it's got the double safety of ";". To accidentally run a SQL statement before it's ready in a command line, you'd have to both add the ";" AND hit Enter, or have the bad practice of adding ";" before the statement is ready, or use a bad SQL command line that sees the ";" as optional.
I always start a session with BEGIN, write UPDATEs/DELETEs as SELECTs first and (if possible) use a staging database until I'm fine with the result.
In SQL, you can at least wrap the whole thing in a transaction. Then, just roll the whole thing back if anything came out wrong.
I usually SELECT COUNT(*) WHERE ..., and only subsequently overwrite with DELETE.