This is what I was told when I started work. If you make a mistake, just admit to it. They most likely won't punish you for it if it wasn't out of pure negligence
It's difficult because you have a 50/50 of having a manager that doesn't respect mistakes and will immediately get you fired for it (to the best of their abilities), versus one that considers such a mistake to be very expensive training.
I simply can't blame people for self-defense. I interned at a 'non-profit' where there had apparently been a revolving door of employees being fired for making entirely reasonable mistakes and looking back at it a dozen years later, it's no surprise that nobody was getting anything done in that environment.
Incredibly short-sighted, especially for a nonprofit. You just spent some huge amount of time and money training a person to never make that mistake again, why would you throw that investment away?
I was a sysadmin in the US Air Force for 20 years. One of my assignments was working at the headquarters for AFCENT (Air Forces Central Command), which oversees every deployed base in the middle east. Specifically, I worked on a tier 3 help desk, solving problems that the help desks at deployed bases couldn't figure out.
Normally, we got our issues in tickets forwarded to us from the individual base's Communications Squadron (IT squadron at a base). But one day, we got a call from the commander of a base's Comm Sq. Apparently, every user account on the base has disappeared and he needed our help restoring accounts!
The first thing we did was dig through server logs to determine what caused it. No sense fixing it if an automated process was the cause and would just undo our work, right?
We found one Technical Sergeant logged in who had run a command to delete every single user account in the directory tree. We sought him out and he claimed he was trying to remove one individual, but accidentally selected the tree instead of the individual. It just so happened to be the base's tree, not an individual office or squadron.
As his rank implies, he's supposed to be the technical expert in his field. But this guy was an idiot who shouldn't have been touching user accounts in the first place. Managing user accounts in an Airman job; a simple job given to our lowest-ranking members as they're learning how to be sysadmins. And he couldn't even do that.
It was a very large base. It took 3 days to recover all accounts from backup. The Technical Sergeant had his admin privileges revoked and spent the rest of his deployment sitting in a corner, doing administrative paperwork.
My trick is writing it as a SELECT statement first, making sure it's returning the right number of records, and then switching out the SELECT for DELETE. Hasn't steered me wrong yet.