Search⌘ K

AS Aliases for Columns and Tables

Learn how to add aliases in tables.

Step 1: Start with a question

You already know how to filter and sort. Now imagine your results being read by someone else, a manager, teammate, or your future self.

Here’s a question to start: Show me employee names and salaries, but make the column names more human-friendly.

Prompt: Write a SQL query that shows employee first name and salary, but rename the columns to Employee Name and Annual Salary.

Ask AI to translate that request.

Powered by AI
5 Prompts Remaining
Prompt AI WidgetOur tool is designed to help you to understand concepts and ask any follow up questions. Ask a question to get started.

Step 2: Run and observe

AI might generate:

MySQL
SELECT first_name AS "Employee Name",
salary AS "Annual Salary"
FROM employees;

 Run it. ...