Last modified on February 1st, 2021
The aliases in SQL can be used to give a temporary name to a table, or a column in a table.
Why we use Aliases in SQL?
Aliases are used to make temporary names.
Aliases are used to make column names more readable.
Aliases exist only when we run the query. It does not change the table structure.
Syntax of Alias Column
SELECT columnName AS aliasName
Syntax of Alias Table
FROM tableName AS aliasName;
Example of aliases in SQL
SELECT name AS n, fee AS f
Let’s see one another example in which we have created two aliases.
one for the name column and one for the fee column.
if the alias name contains spaces, then we need to use the double quotation marks or square brackets in our query.
SELECT name AS “n b”, fee AS f
Exercise: Download the Database of aliases in sql and practice it on your XAMPP phpMyAdmin.
How to SQL PERFORMANCE TUNING?
- How to write a resume for a job search: Tips for applicants - May 11, 2021
- The Best Tool to Test the Speed of Your Internet - May 5, 2021
- Why do we need various number systems in computer science? - April 16, 2021