Tom Garth (9/30/2009)
I agree with Tao that thoughtful aliasing, as opposed to A. B, C, will make code easier to read for the programmer, debugger, or DBA. Most who have been around a little while won't have to wonder what OH and OD reference. OH.customer_name doesn't present nearly the challenge to read as does SalesOrderHeader.customer_name.
I disagree. OH is much less meaningful than SalesOrderHeader. OH is not any easier or harder to read, but it means less. OH! It means OH, I forgot to name something.
Yes, you can create hugely long table names in an example to make the example look silly. But SalesOrderHeader is MUCH more meaningful than OH. OH could stand for the state of Ohio, or Old Hat, or OverHeat, or OrdersHandled, or OmitHeader, or OrdersHalted, or any one of a number of things. SalesOrderHeader does not have that problem. The table alias does NOT add anything meaningful, and it forces us to do an additional translation.
Yes, if you work with it all of the time, then you'll learn what OH stands for. And you'll learn what SOL stands for. SOL doesn't scream "line number" to me. The second programmer to come to the code sees SOL and thinks he's s*it out of luck figuring it out. Sales Order Line? Standing Order Link? Sales Omitted Late? WTF?
"Most who have been around a little while won't have to wonder what OH and OD reference." Bullsh!t. I have no idea what they reference.