How to use column and table aliases
Alias a column
AS labels a result column without changing the stored column name.
SELECT title AS course_title,
duration_minutes AS minutes
FROM courses;
Alias a table
A table alias shortens qualified names, especially in joins. After assigning an alias, use it consistently in that query.
SELECT c.title, c.level
FROM courses AS c;
Choose portable names
Simple unquoted aliases work across databases. Quoting rules differ: standard SQL and PostgreSQL use double quotes, MySQL often accepts backticks, and SQLite accepts several forms.
Remember the scope
An alias exists only while the statement runs. It does not rename the table or column in the database.