SELECT with WHERE Clause
Return employees who earn more than $80,000.
- Filtering
Exercise brief
Understand the request
Finance analyst The payroll review is focused only on employees above the high-salary threshold.
List employees who earn strictly more than $80,000. Return three columns — first_name, last_name, salary — for those employees only.
Return
- Return first_name, last_name, and salary.
Constraints
- Filter with WHERE salary > 80000.
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
WHERE goes after FROM and filters rows before they reach the SELECT list. "More than $80,000" is a strict comparison — use `>`, not `>=`.
Hint 2
Syntax: SELECT … FROM … WHERE <column> <operator> <value>;
Hint 3
Add a WHERE clause after FROM and use the strict greater-than operator with the stated threshold.
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 WHERE salary > 80000;Why this works
WHERE is a row filter that runs before SELECT. The expected answer has 4 rows (John, Alice, Emma, Grace). A common mistake is using `>=` which would include Bob at $80,000 — read the prompt for "more than" (>) vs "at least" (>=).
Expected result
Use this output to verify values, aliases, ordering, and row count.
| first_name | last_name | salary |
|---|---|---|
| John | Smith | 120000 |
| Alice | Johnson | 85000 |
| Emma | Taylor | 95000 |
| Grace | White | 90000 |
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.