SELECT Statements SQL Topic exerciseEasyVerified answerSQLite + PostgreSQL + MySQL + SQL Server live · 1 guided

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_namelast_namesalary
JohnSmith120000
AliceJohnson85000
EmmaTaylor95000
GraceWhite90000

Learn the concepts behind this answer

Strengthen your understanding with these targeted learning topics:

Continue practicing

SQL Practice Online

Open the interactive workspace and practice across SQL topics.