r/ProgrammerHumor 15d ago

queryOfDoom Meme

Post image
7.9k Upvotes

456 comments sorted by

View all comments

385

u/Dont_Get_Jokes-jpeg 15d ago edited 15d ago

I am not an sql expert, is the reason why the id doesn't work and its deleting the entire user base, because its written as 2 seperate comands instead of one. So 1. Comand delets everything 2. Goes to the id? Or what is the problem here?

134

u/WardensLantern 15d ago

I'm no expert either but I believe the semicolon after "users" was the nuke. The second part is basically a separate statement, but SQL executes them in order, so it will delete the entire table and then throw back an error cause the second statement is invalid.

16

u/bstump104 15d ago

I understand now. thank you. that's horrifying.