Ravi Sir's Cyber Security Cards › Revision Cards
LIKE, IN, BETWEEN and NULL
LIKE, IN, BETWEEN and NULL LIKE matches patterns (% = any text, _ = one letter). IN matches a list. BETWEEN matches a range. WHERE name LIKE '_a%' = names with “a” as the second letter. WHERE email = NULL returns nothing. NULL means “unknown” and can’t be compared with =. Use IS NULL or IS NOT NULL

Read card text
What this card says
What it is
LIKE matches patterns (% = any text, _ = one letter). IN matches a list. BETWEEN matches a range.
Example
WHERE name LIKE '_a%' = names with “a” as the second letter.
Common mistake
WHERE email = NULL returns nothing.
NULL means “unknown” and can’t be compared with =. Use IS NULL or IS NOT NULL.
| Wildcard | Meaning | Example |
|---|---|---|
| % | Zero or more characters | 'Pu%' → Pune |
| _ | Exactly one character | 'R_ja' → Raja |
Learn more in the lesson: 10.7 LIKE, IN, BETWEEN and NULL