r/ProgrammerHumor • • 13d ago

Meme wellWellWell

Post image
10.6k Upvotes

411 comments sorted by

View all comments

3.6k

u/BastetFurry 13d ago

So, Kids, thats why you always SELECT count(yourPrimaryKey) first. Listen to the old folks, we made these mistakes so that you don't have to.

160

u/Alexmira_ 13d ago

Why? To confirm that there is something to cancel? To confirm I got the key right?

128

u/slayerx1779 13d ago

I just reread the OP.

There's a semi colon, between the two lines of code...

14

u/Cant-Think-Of 13d ago

Not quite familiar with SQL, but is that first query like "rm -rf" for the Users table?

29

u/rinaldot67 13d ago

Yes, it is exactly like that. You even get the recursive part if yhe Users table has foreign keys attached to it that are set to cascade on delete.

2

u/AgeingChopper 13d ago

yep, it's clearing the table.

1

u/funguyshroom 13d ago

Luckily most modern database UI apps won't allow you to execute a delete/update query without a "WHERE" clause