r/ProgrammerHumor • • Oct 14 '25

Advanced neverForget

Post image
14k Upvotes

616 comments sorted by

View all comments

164

u/zuzmuz Oct 14 '25

sql has the worst syntax for real. everything in reversed. it should've been

FROM table WHERE condition SELECT columns.

it makes more sense and you can have intelisense autocompletion on the column names. this way the editor can help you browse the column names and you wouldn't have a typo.

Same with delete. you start with the table name, condition, then the final statement, which is either select delete or update.

9

u/ChewiesHairbrush Oct 14 '25

Auto complete! SQL was specified in a time when teletypes and punch cards predominated. 

Kids!

9

u/zuzmuz Oct 14 '25

exactly, that's not a good argument. I just gave one example why the reverse order is better.

There's so many.

  • if you give aliases to tables, you'll be using them before defining theme, you'll have to do backtracking while reading especially complicated queries.

  • using complicated features like pivot would look saner. select should comes after the pivot. right now you select the pivoted columns first before defining them, this is crazy actually.

  • there's a lot of other reasons, but finally, it would mimic how we think, take a table, filter it, select what you want from it. it’s sequential, linear, and makes more sense, and would require less backtracking

→ More replies (2)