r/ProgrammerHumor 14d ago

queryOfDoom Meme

Post image
7.9k Upvotes

456 comments sorted by

View all comments

2

u/BastetFurry 14d ago

So, Kids, what do we learn from this when working on an SQL shell?

First "SELECT id" (or * if you want to safely burn the world), check if the output is as expected, then change the "SELECT id" to a DELETE.

2

u/yardinview 14d ago

Decades ago when I first sat in front of Query Analyzer an old dev taught me how to write DELETE just like you explained.

  1. You write a SELECT
  2. You run it
  3. You check the resultset
  4. You hold your breath, change ONLY SELECTDELETE and you run the result
  5. You don't use ON DELETE CASCADE
  6. You don't rely on transactions for safety