Aliases
AS gives a column or table a temporary name. Aliases make results easier to read and long table names easier to type, which matters a lot in joins.
Example
SELECT name AS student, score AS points
FROM students
WHERE id <= 2;Result
student | points Ada | 92 Kofi | 78
Example
SELECT s.name, s.country
FROM students AS s
WHERE s.id = 3;Result
name | country Amina | Nigeria
Exercise
Rename the column in the result.
SELECT name student FROM students;
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.