SELECT Specific Columns
Return first_name, last_name, and salary from employees.
Exercise brief
Understand the request
Compensation coordinator The review sheet only needs employee names and current salary, not the full row.
Return only three columns from the employees table — first_name, last_name, and salary — in that exact order.
Return
- Return first_name, last_name, and salary only.
Constraints
- Use column projection instead of SELECT *.
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
employees
first_nameVARCHAR(50)last_nameVARCHAR(50)salaryINTEGER
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
List the columns you want after SELECT, separated by commas. The order in the SELECT list is the order they appear in the result.
Hint 2
Syntax: SELECT col1, col2, col3 FROM table;
Hint 3
Build a three-column SELECT list in the requested order, then add the employees table.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT first_name, last_name, salary FROM employees;Why this works
Listing columns explicitly is called "projection". It returns only the data you need, makes the result easier to read, and protects your query from breaking when extra columns are added to the table later.
Success check
Every employee appears once with only first_name, last_name, and salary in the requested column order; row order is not assessed.
Expected result
Use this output to verify values, aliases, ordering, and row count.
| first_name | last_name | salary |
|---|---|---|
| John | Smith | 120000 |
| Alice | Johnson | 85000 |
| Bob | Wilson | 80000 |
| Carol | Davis | 60000 |
| David | Brown | 70000 |
| Emma | Taylor | 95000 |
| Frank | Green | 65000 |
| Grace | White | 90000 |
| Henry | Clark | 55000 |
| Ivy | Martinez | 68000 |
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.