News for hackers. Stuff that matters.
Re:Best practices for writing SQL queries by magicalhippo on Saturday April 10, 2021 @02:51PM (#26763964)
I got descriptive table names like WhsTransactionGoodsItems and WhsTransactionGoodsItemPackages.

I feel it would be rather noisy to have to specify such table names in front of the 15+ column references in a query, compared to using aliases.

Then again I've never had to diff the result sets, so I guess our usage is quite different.

Re:Best practices for writing SQL queries by mulmen on Saturday April 10, 2021 @04:43PM (#26764972)
My editor has tab completion, it's not like you have to type every character. I prefer it for readability but it's definitely debatable.
Re:Best practices for writing SQL queries by magicalhippo on Saturday April 10, 2021 @05:22PM (#26765252)
Readability is weird heh, I'm exactly the opposite. For me long lines become a blur, so better to have a short alias.
Re:Best practices for writing SQL queries by mulmen on Saturday April 10, 2021 @05:48PM (#26765444)
I know what you mean. I think this is really a matter of readability vs comprehension. I want all the context on one line so I can understand it, even if that does technically make it harder to read that line.

This is especially a problem in huge queries.