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 Students Can Pick a Good Custom-Paper Writing Service? - March 5, 2021
- List of Public service commissions - August 31, 2020
- Comparison of fee structure of Pakistani Universities - June 1, 2020