Example 1
Rename selected columns for clearer output
The data does not change, only the column labels in the result set. first_name is shown as employee_name, and salary is shown as annual_salary.
Source table data Rows loaded before the example query runs.
Setup
CREATE TABLE employees (id INT, first_name VARCHAR(50), salary INT);
INSERT INTO
employees (id, first_name, salary)
VALUES
(1, 'Ada', 90000),
(2, 'Linus', 95000);Validated query Shared across supported engines.
SQL
SELECT
first_name AS employee_name,
salary AS annual_salary
FROM
employees
ORDER BY
id;Expected result Returned rows for the shared example.
| employee_name | annual_salary |
|---|---|
| Ada | 90000 |
| Linus | 95000 |
All engines use the same `AS` alias syntax for output column names in this example.