SELECT with Column Aliases
Return first_name and last_name using friendly aliases.
Exercise brief
Understand the request
HR reporting analyst The exported file needs readable column names instead of raw database column labels.
Return first_name as "First Name" and last_name as "Last Name" from employees. Use double-quoted aliases so the labels keep their spaces and capitalisation.
Return
- Return columns labeled First Name and Last Name.
Constraints
- Use column aliases in the SELECT list.
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
employees
first_nameVARCHAR(50)last_nameVARCHAR(50)
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
AS gives a column a different label in the result. The original column name is unchanged in the table.
Hint 2
Use double quotes for aliases that contain spaces or capitalisation: SELECT col AS "My Label".
Hint 3
Alias each requested name column separately; quote aliases that contain spaces.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT first_name AS "First Name", last_name AS "Last Name" FROM employees;Why this works
Aliases rename columns only in the result, never in the underlying table. Quoting matters: ANSI SQL uses double quotes, MySQL uses backticks, SQL Server uses square brackets. The portable habit is double quotes.
Success check
Every employee appears once and the two output labels are First Name and Last Name.
Expected result
Use this output to verify values, aliases, ordering, and row count.
| First Name | Last Name |
|---|---|
| John | Smith |
| Alice | Johnson |
| Bob | Wilson |
| Carol | Davis |
| David | Brown |
| Emma | Taylor |
| Frank | Green |
| Grace | White |
| Henry | Clark |
| Ivy | Martinez |
Learn the concepts behind this answer
Strengthen your understanding with these targeted learning topics:
Continue practicing
Build the next SQL skill
WHERE Clause & Filtering
Practice SQL WHERE clauses with realistic boundary, NULL, text, date, exclusion, and production-filtering problems.
Basic SQL Functions
Practice production-oriented string cleanup, numeric transformations, NULL handling, tolerant conversion, and delimiter parsing.
ORDER BY & Sorting
Practice deterministic SQL ordering with tie-breakers, custom priorities, NULL placement, expressions, joined data, aggregates, and portable top-N patterns.
Open the interactive workspace and practice across SQL topics.