WHERE — Filtering Rows, and What NULL Means
So far we got every row. In real work you almost always want only some of them: the customers from Haifa, the orders that were paid. In this lesson you meet WHERE, comparisons, AND and OR, and NULL — the value that trips up interview candidates more than anything else. You also meet the shop's order
WHERE is a sieve: only rows whose condition is true get through. NULL means "unknown", so you test it with IS NULL, not with =.
- WHERE clause
- The part of a query that keeps only the rows whose condition is true.
- Comparison operator
- A symbol that compares two values: =, <>, >, <, >=, <=.
- NULL
- A marker for a missing or unknown value. It is not zero and not an empty string.
- Empty string
- A known text value with no characters, written ''.