Skip to content
/Chapter 3 · Select, Filter, and Sort
Lesson 3.5·garden_shop
Lesson 3.5

SQL BETWEEN Operator: Filtering Ranges

Range filters are cleaner when the lower and upper bounds are written together.

BETWEEN checks whether a value is inside a range. It is often clearer than writing one condition for the lower bound and another condition for the upper bound.

The important detail: BETWEEN is inclusive. A value equal to the start or end of the range is included.

Pattern
select column_one, column_two
from table_name
where column_name between lower_value and upper_value
Schema · Garden ShopTable · orders6 columns · 24 rows
Table · orders

One row per order. Unshipped orders have a null shipped_date.

6 columns · 24 rows
order_id intcustomer_id intorder_date dateshipped_date datestatus textcoupon_code text
Your task

Show the order id, order date, and status for orders placed during March 2024.

SQL Workbench
query.sqlgarden_shop · SQL engine loading
⌘↵ to run
·
Expected answer
  • Columns: order_id, order_date, status.
  • Rows: 4 March orders.
  • Dates should run from 2024-03-02 through 2024-03-30.