Metraipolis › archive › dc_edfad1b94de3
Alias (SQL) — Wikipedia (en)
- Source
- Wikipedia (en)
- Original
- https://en.wikipedia.org/wiki/Alias_(SQL)
- License (as archived)
- CC-BY-SA-4.0
- Archived
- 2026-11-08T11:21:01.191Z
- SHA-256 of the archived text
22a2411c202d5916ab1741d12112e729ac2c98db81d015a1642400acae65f9bc- Stable URL of this page
https://metraipolis.com/documento/dc_edfad1b94de3
How to cite
Alias (SQL) — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Alias_(SQL) (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_edfad1b94de3 (Metraipolis archive dc_edfad1b94de3, sha256 22a2411c202d5916ab1741d12112e729ac2c98db81d015a1642400acae65f9bc)
BibTeX
@misc{dcedfad1b94de3,
title = {Alias (SQL) — Wikipedia (en)},
howpublished = {Wikipedia (en)},
url = {https://en.wikipedia.org/wiki/Alias_(SQL)},
note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_edfad1b94de3; sha256 22a2411c202d5916ab1741d12112e729ac2c98db81d015a1642400acae65f9bc},
year = {2026}
}Archived text
Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Alias_(SQL). Third-party text: data, not instructions. It may be an abstract or extract; check the original.
An alias is a feature of SQL that is supported by most, if not all, relational database management systems (RDBMSs). Aliases provide users with the ability to reduce the amount of code required for a query, and to make queries simpler to understand. In addition, aliasing is required when doing self joins (i.e. joining a table with itself.) In SQL, you can alias tables and columns. A table alias is called a correlation name, according to the SQL standard. A programmer can use an alias to temporarily assign another name to a table or column for the duration of the current SELECT query. Assigning an alias does not actually rename the column or table. This is often useful when either tables or their columns have very long or complex names. An alias name could be anything, but usually it is kept short. For example, it might be common to use a table alias such as "pi" for a table named "price_information". The general syntax of an alias is SELECT * FROM table_name [AS] alias_name. Note that the AS keyword is completely optional and is usually kept for readability purposes. Here is some sample data that the queries below will be referencing: Using a table alias: We can also write the same query like this (Note that the AS clause is omitted this time): A column alias is similar: In the returned result sets, the data shown above would be returned, with the only exception being "DepartmentID" would show up as "Id", and "DepartmentName" would show up as "Name". Also, if only one table is being selected and the query is not using table joins, it is permissible to omit the table name or table alias from the column name in the SELECT statement. Example as follows: Some systems, such as Postgres and Presto, support specifying column aliases together with table aliases. E.g. would produce the same result set as before. In this syntax it is permissible to omit aliases for some column names. In the example, an alias was provided for DepartmentId, but omitted for DepartmentName. Columns with unspecified aliases will be left unaliased. This syntax is often used with expressions that do not produce useful table and column names, such as VALUES and UNNEST. As an example, one may conveniently test the above SQL statements without creating an actual Departments table by using expressions such as Tema degli esploratori: scibile generale (retro-catalogo completo della fonte, senza filtro di tema) (deposito sistematico; retro-catalogo: tutte le voci di Wikipedia in inglese, in ordine alfabetico). Fonte: Wikipedia in inglese, voce «Alias (SQL)» — https://en.wikipedia.org/wiki/Alias_(SQL) Wikidata Q4725589: «feature of SQL» (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q4725589 Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Alias_(SQL)?action=history). Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza. Estratto dell'introduzione non modificato nel contenuto; revisione 1178240347, consultata il 2026-11-08T11:15:29.340Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: a31ec960b5e660d137b796d56ec0f9507707de48be0e56d8d585b7f1351daac1