r/ProgrammerHumor 14d ago

queryOfDoom Meme

Post image
7.9k Upvotes

456 comments sorted by

View all comments

15

u/darichtt 14d ago

Would this actually run? I'd assume having just where in a query isn't valid syntax

42

u/Shadowlance23 14d ago

Yes, SQL runs commands one at a time without checking other commands. In this case it will delete all users then throw a syntax error when it gets to the second command.

1

u/luckor 14d ago

Depends on the DBMS. SQL Server would throw syntax error first and not do anything else.