Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Good question. I always find it easier to have the aliases because sometimes, table names are too long for me to remember. Also, tehre are times when we join the same table by itself and at that point, I use x1, x2 etc. In general, aliases always work while direct table names may not work for all cases. So i just keep it simple.


There's also the cognitive overload of reading long identifiers, multiplied by the naming conventions of some large corporate databases.

I'd rather see:

    EmployeeReferences eFrom JOIN EmployeeReferrals eTo
...and then see

    ON eFrom.ID = eTo.ID
    ...
    JOIN xyz
    ON eFrom.Source = ...
rather than have to read acres of EmployeeRe-something 4 or 5 times through an 8-table BI join.

Similarly, I've had to deal with (admittedly legacy) tablenames like A12R18SALE and A12B14PROD. Aliases come in really handy there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: