Column Alias in SQL

Level 123 keystrokes

AS keyword gives a custom name (alias) to the result column.

SQL code

-- 5 + 3 is evaluated to 8
-- AS result names the column, so the header shows result instead of 5 + 3
1SELECT 5 + 3 AS result;

Output

+--------+
| result |
+--------+
|      8 |
+--------+
1 row in set
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this SQL code and how often they appear.

  • ;× 1
  • +× 1

More SQL examples at level 1

← SQL typing practice