The AS Keyword
AS gives a column a temporary name (alias).
Syntax
sql
1SELECT column AS alias_name FROM table;Example
sql
1SELECT name AS student_name FROM students;Result
| student_name |
|---|
| Alice |
| Bob |
Why Use Aliases?
- More readable column names
- Required for calculated columns
- Shorter names for long columns
