An Alias is a name given to any table or column temporarily. This can be done for a query or stored procedure. The renaming is a temporary change and the actual table name does not change in the database.

SYNTAX: Table Alias

112.png

SYNTAX: Column Alias

113.png

Where,

  • Alias_name: keyword used to give a temporary name to a table/column

 
 

EXAMPLE

Let us consider a demo database with table name Persons & Salaries

114.png

Figure 31.1.SELECT * FROM PERSONS;

115.png

Figure 31.2. SELECT * FROM SALARY;

TABLE ALIAS:

116.png
 

Figure 31.3. TABLE ALIAS;

COLUMN ALIAS:

117.png

Figure 31.4. COLUMN ALIAS

 
 

PRACTICE YOURSELF

118.png