📝 Introduction
SQL Aliases allow you to give a temporary name to a column or table using AS
. This improves readability and clarity in your queries.
1️⃣ Column Aliases
-- Rename column in output
SELECT EmpID AS Employee_ID,
FirstName AS Name,
Salary AS Monthly_Salary
FROM Employees;
2️⃣ Table Aliases
-- Rename table for easier reference
SELECT e.FirstName, e.Salary
FROM Employees AS e
WHERE e.Salary > 5000;
Tip: Table aliases are especially useful when joining multiple tables to shorten query syntax.
✅ Key Takeaways
- Use
AS
to rename columns temporarily - Table aliases simplify joins and complex queries
- Aliases improve query readability without changing actual table/column names
📚 Continue Learning
💬 Questions about SQL Aliases? Leave a comment!