SQL Alias is the temporary name that exists for a particular query. Alias is used for better understanding and reducing the workload of writing big column names. Aliases are the temporary name and the changes made with the column name while retrieving does not reflect in the original database.

SQL Alias Example

An Alias is a shorthand for the  table or column name. Aliases reduce the amount of typing required to write the query. Complex queries with the aliases are generally easier to read. Aliases are useful with  JOINs and  SQL aggregates: SUM, COUNT, etc. SQL Alias only exists for the duration of that query.

Aliases are useful in these scenarios. When there is more than one table involved in the query Functions are used in that query. When the column names are big or not very readable. When there are two or more columns are combined together. Alias is also used when more than one table is involved, i.e., when the  joins are used. These types of Aliases are known as Table Alias.

#sql #sql alias #table alias

SQL Alias Example | Alias In SQL Tutorial
1.90 GEEK