Alias (SQL): Difference between revisions

Content deleted Content added
WikiCleanerBot (talk | contribs)
m v2.05b - Bot T20 CW#61 - Fix errors for CW project (Reference before punctuation)
hyperlink
 
Line 1:
{{Short description|Feature of SQL}}
{{refimprove|date=October 2013}}
An '''alias''' is a feature of [[SQL]] that is supported by most, if not all, [[RDBMS|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 [[Column (database)|columns]]. A table alias is called a '''correlation name''', according to the SQL standard.<ref>ANSI Standard SQL – Foundation Document – Date: 2010-10-14</ref> A programmer can use an alias to temporarily assign another name to a table or column for the duration of the current [[Select (SQL)|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".