Chapter 2 · 6 levels
Filtering rows
Keep only the rows you need with WHERE: comparisons, AND/OR/IN, date ranges, pattern matching and NULL checks.
StartNobody wants all 12,000 orders. They want last month’s refunds, or business customers in Texas, or products that are missing a cost. Filtering is how you turn a table into an answer.
This chapter covers WHERE with comparisons, combining conditions with AND, OR and IN,
filtering a timestamp column by date without losing the last day, matching text patterns, and the
single most common trap in SQL: comparing with NULL. The boss level is a data quality sweep for
the operations team.
Levels
- Orders from March 2024
from Kevin Brooks, Operations Manager
dates, timestamp, between, half open range
- The NULL comparison trap
from Lauren Hayes, Email Marketing Manager
null, is null, three valued logic
- Boss: data quality sweep
from Kevin Brooks, Operations Manager
where, is null, and or, in, date ranges