Alias Syntax

In this lesson, we will learn about assigning aliases to tables and columns.

Alias syntax

You can rename a table or a column temporarily by giving another name known as an Alias. The use of table aliases is to rename a table in a specific SQL statement. Column aliases are used to rename a table’s columns for a particular SQL query. This renaming is a temporary change and the actual table/column name does not change in the database.

Syntax of a table alias

The basic syntax of a table alias is as follows:

SELECT column1, column2 ... columnN

FROM table_name AS alias_name

WHERE condition;

Example

For our example, we will be using the following tables:

Get hands-on with 1400+ tech skills courses.