AS — Use Aliases / Shorthand in SQL to make more readable queries — Parv The IT Geek

Have you ever wondered how I can make my SQL queries look more readable, manageable and simpler?

Well the answer is to use the ‘AS’ command as this can alias tables.

For example the below query can seem quite daunting with long table names.

USE AdventureWorks 
SELECT HumanResources.Department.DepartmentID, HumanResources.Department.Name, HumanResources.Department.GroupName, HumanResources.Department.ModifiedDate
FROM HumanResources.Department

However, the below query using the ‘AS’ command to alias the HumanResources.Department makes it look better, simpler and is quicker to read.

USE AdventureWorks
SELECT HRDept.DepartmentID, HRDept.Name, HRDept.GroupName, HRDept.ModifiedDate
FROM HumanResources.Department AS HRDept

As you become more proficent in SQL you will find yourself aliasing tables all the time and probably won’t even notice yourself doing it

Originally published at on January 21, 2014.


Published by Parvinder Nijjar

I blog at

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: