In its simplest form, data filtering is the process of removing unwanted data. You prescribe one or more rules (i.e. filters) that each data value must meet to remain included.
Each time a data value passes through your prescribed filter, the output is either True (keep the data) or False (remove the data). For example, let's pretend you're working with the following dataset:
Age: 10, 12, 25, 30, 60
A question you could ask about this dataset (which would ultimately be answered by use of a filter) would be:
How many ages are equal to 10?
Behind the scenes, when you apply a filter to a dataset each value is checked against your rule. In our example, the following would occur:
10 = 10 True
12 = 10 False
25 = 10 False
30 = 10 False
60 = 10 False
Everything that outputs "False" is removed, leaving you with a single result (and the answer to our question).
Here's a list of the most commonly used filters (don't worry, we'll show examples of each):
SQL Operator | Filter Condition | Used to Filter |
= | Equal to | Dates / Numbers / Text |
<> or != | Not equal to | Dates / Numbers / Text |
< | Less than | Dates / Numbers |
<= | Less than or equal to | Dates / Numbers |
>= | Greater than or equal to | Dates / Numbers |
> | Greater than | Dates / Numbers |
BETWEEN | >= and <= | Dates / Numbers |
NOT BETWEEN | > and < | Dates / Numbers |
IN | Equal to _ or _ or ... | Dates / Numbers / Text |
NOT IN | Not equal to _ or _ or ... | Dates / Numbers / Text |
IS NULL | Empty | Null values |
IS NOT NULL | Not empty | Not null values |
LIKE | Pattern matching | Text |
NOT LIKE | Pattern not matching | Text |