Basics · Lesson 7 of 19

Range Queries with BETWEEN

BETWEEN filters values within a range (inclusive).

SELECT * FROM employees
WHERE salary BETWEEN 70000 AND 90000;

This is the same as:

WHERE salary >= 70000 AND salary <= 90000

BETWEEN works with:

  • Numbers
  • Dates
  • Text (alphabetically)

Both endpoints are included!

Check your understanding

Find employees earning between $75,000 and $95,000.

Examples run on the employees sample database. Open any of them in the playground to experiment.