From the course: Microsoft SQL Server 2016: Query Data

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using aliases in your SELECT statements

Using aliases in your SELECT statements - SQL Server Tutorial

From the course: Microsoft SQL Server 2016: Query Data

Start my 1-month free trial

Using aliases in your SELECT statements

- [Narrator] In this lesson, we'll introduce table aliases and column aliases. These two types of aliases are the most common that you find in SQL Server. And each one has a very specific purpose within the context of Transact-SQL code. The first one we'll take a look at is a table alias. Now we have a simple select statement here for the employee table and we're going to select three specific attributes similar to what we did in the video on the simple SELECT statement. But what we're doing differently in here is we're actually making use of a table alias. And we create a table alias in our FROM clause by immediately following the table name with the AS key word and then what we want to use as a designator for that table alias. Now in this instance I've used hre. And the reason I've done so is because it's relatively self-explanatory. when I look at any one of my column Ids I can pick out HumanResources Employee which is the hre that I've created. Why do I actually have to use this…

Contents