SQL Server Interview Question #55

What is an alias in SQL Server?

SELECT, Filtering, Sorting & Built-in Functions Mid-Level Intermediate

Detailed Explanation

An alias gives a temporary name to a column expression or data source within a query. Column aliases improve result readability, while table aliases make joins and long object names easier to reference.

AS is optional for many aliases, but using clear, short aliases improves maintainability.

Code Example

SELECT p.Id,
       p.Name AS ProductName,
       p.Price AS UnitPrice
FROM dbo.Products AS p;