Recall & Review
beginner
What is a column alias in SQL?
A column alias is a temporary name given to a column in the result set of a query to make the output easier to read or understand.
Click to reveal answer
beginner
How do you use the AS keyword in SQL?
You use AS to assign a new name (alias) to a column or expression in the SELECT statement, like: SELECT column_name AS alias_name FROM table_name;
Click to reveal answer
beginner
Why would you use a column alias in a query?
To make column names more readable, to rename complex expressions, or to prepare output for reports or user interfaces.
Click to reveal answer
intermediate
Can you use column aliases without the AS keyword?
Yes, in many SQL dialects you can write SELECT column_name alias_name FROM table_name; but using AS improves clarity.
Click to reveal answer
beginner
Example: Write a query to select the column 'price' from 'products' table and rename it to 'Cost'.
SELECT price AS Cost FROM products;
Click to reveal answer
What does the AS keyword do in SQL?
✗ Incorrect
AS is used to give a temporary name (alias) to a column or expression in the query result.
Which of the following is a correct way to alias a column named 'salary' as 'Income'?
✗ Incorrect
The correct syntax uses AS to assign the alias: SELECT salary AS Income FROM employees;
Is the AS keyword mandatory when creating a column alias?
✗ Incorrect
AS is optional in many SQL dialects but recommended for clarity.
What will this query return? SELECT price AS Cost FROM products;
✗ Incorrect
The query returns the 'price' column data but names the column 'Cost' in the output.
Why might you want to use a column alias?
✗ Incorrect
Column aliases help make query results clearer without changing the actual table.
Explain what a column alias is and how to use the AS keyword in SQL.
Think about how you rename columns temporarily in query results.
You got /3 concepts.
Describe why column aliases are useful when writing SQL queries.
Consider how output looks to users or reports.
You got /3 concepts.