table alias
A short name given to a table inside one query, such as c for customers, used to qualify its columns.
In more detail
Write it after the table name in FROM or JOIN, optionally with AS. Aliases are required when the same table appears twice, such as employees joined to their managers, and make every join easier to read.
Example
FROM order_items AS oi JOIN products AS p ON p.id = oi.product_idRelated terms
- AS — The keyword that gives a column, expression or table a new name in a query.
- qualified column name — A column name written with its table or alias in front, such as c.name, so the database knows which table it means.
- join — Combining rows from two tables into one result by pairing rows according to a rule, usually matching keys.
Taught in
- Inner Joins And Table Aliases — PostgreSQL, Indexing & Relational Data Modeling