codegurukool.com · Free coding tutorials & online compiler

Home › SQL Tutorial › SQL aliases

SQL aliases

Give columns and tables temporary names.

AS renames a column in the result, or a table inside the query. Aliases make long queries easier to read.

Example code

SELECT name AS customer, city AS town
FROM Customers
WHERE id <= 2;

Run this code in the online editor

← SQL IN and BETWEENSQL INNER JOIN →