News for hackers. Stuff that matters.
Re:Best practices for writing SQL queries by alex_anglin on Saturday April 10, 2021 @01:35PM (#26763292)
To each their own, but in the case of ETL/ELT, you would just be asking for pain not using aliases.
Re:Best practices for writing SQL queries by gizmodo59 on Saturday April 10, 2021 @01:55PM (#26763459)
Even there someone needs to read them eventually than just the person who wrote it. Single letter aliases are just evil. In some ways it’s the same as doing: String x = “Hello”
Re:Best practices for writing SQL queries by dragonwriter on Saturday April 10, 2021 @02:10PM (#26763595)
> Even there someone needs to read them eventually than just the person who wrote it.

That’s not an argument against table aliases, its an argument against unclear table aliases.

Single letter table aliases are better than just using unqualified column names, both of which are worse than table aliases guided by the same naming rules you’d use for semantically-meaningful identifiers in regular program code.

Re:Best practices for writing SQL queries by mulmen on Saturday April 10, 2021 @04:42PM (#26764960)
In the case of ETL you should only be referencing those tables a few times because you are integrating them into friendly analytic models. In that case you probably have a lot of columns to wrangle and complex transformation logic. In those cases I prefer to use no alias at all to avoid the scrolling around to get context, even when table names are very long.