From the course: Learning SQL Programming

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Creating aliases with AS

Creating aliases with AS - SQL Tutorial

From the course: Learning SQL Programming

Creating aliases with AS

- [Instructor] It's been a little bit subtle so far, but the names of the fields that we get back when we make a query, and subsequently the names of the field we get in a program or something we'd write, are the names of fields or expressions that we put into the statement to begin with. Usually this makes sense, but sometimes if we have a little bit of a lengthy way of creating a field, or want to be more clear on our output, for example, if we're taking the results directly into a spreadsheet that someone else is going to use or into the data processing portion of an app, we can change the returned name of a field with the AS keyword. Let's take a basic look at that with a statement that will get us the first_name and last_name of the participants in our people table. This is a result we've seen before. Notice how the column headers here are the same as the field names I asked for. And if I transform the names a little bit, that comes through here in the column header. That can be…

Contents