Table Aliases
Table aliases are temporary name that are given to the table especialy when working with multiple tables in a query.Table aliase are defined in FROM clause of query after original table name using AS keyword.let see the example of table aliases:
SELECT e.employee_id, e.first_name, d.department_name
FROM employees AS e
JOIN departments AS d ON e.department_id = d.department_id;
In this above example, the table aliases e and d are assigned to the employees and departments tables, respectively. These aliases are then used to qualify the column names in the SELECT statement and the JOIN condition. Using table aliases you can make the query sort and also helps to avoid the error when column name are shared with tables.
Output:
SQL Server ALIASES
Aliases in SQL Server are the temporary names given to tables or columns to make it easy to read and maintain the data. Aliases help you to provide different names to columns and tables temporarily so that users can easily understand the data of the table and it does not change any data of the table or column. Using aliases complex joins of multiple tables are easy to read and understand so that you perform other operations on columns and tables easily.
Contact Us