What is Alias in SQL | How and Why we use it ? | SQL Developer Interview | Structure Query Lanuage

preview_player
Показать описание
In SQL, an alias is an alternative name for a database object, such as a table or column.
They are used to make it easier to write and read SQL queries, and to make the results of a query easier to understand.
For example, consider the following query:
In this query, o and c are aliases for the orders and customers tables, respectively.
The use of aliases makes it easier to read the query, as it is clear that the order id and customer id columns belong to the orders table, and the name column belongs to the customers table.
Aliases can also be used to give a column a temporary name, like this:
the product_name column is given the temporary name "Product", and the price column is given the temporary name "Price". These temporary names will be used to label the columns in the query results.
Aliases are used in SQL by database developers, data analysts, and other professionals who work with SQL databases.
Рекомендации по теме