AS is a keyword that lets you temporarily rename result columns, expressions, tables, or derived tables inside a single SQL statement. Aliases improve readability, shorten verbose identifiers, and allow self-joins without ambiguity. Most dialects treat AS as optional for aliases, but including it makes intent explicit and keeps code portable. Column aliases exist only in the query result set; they are not persisted in the schema. Table aliases are scoped to the statement and can be referenced in JOIN, WHERE, GROUP BY, HAVING, and ORDER BY clauses. Some databases allow referencing a column alias in ORDER BY but not in WHERE or GROUP BY within the same SELECT. Use double quotes or backticks around the alias if it contains spaces, special characters, or matches a reserved word. Beyond SELECT, AS appears in CREATE TABLE ... AS SELECT and CREATE VIEW, where it defines the new schema based on a query result. AS does not accept parameters and does not change data types (CAST handles type conversion).
SELECT, JOIN, CREATE VIEW, CREATE TABLE AS, CAST, WITH (CTE)
SQL-92
AS literally means "alias" and signals that the preceding column, expression, or table should be referenced by the following name for the duration of the statement.
You can skip AS in most dialects: `SELECT column alias_name`. However, using AS makes the code clearer and avoids edge-case parsing issues, so many teams enforce it with linters.
SQL evaluates WHERE before SELECT, so the alias does not yet exist. ORDER BY runs after SELECT, so the alias is available. If you need the alias in WHERE, wrap the query in a subquery and filter outside.
No. Aliases are temporary and exist only for the duration of that single SQL statement or the view/table you create with it. They do not alter the physical schema.