
But I include NOT LIKE because its existence and functionality is a natural consequence with how NOT and LIKE and the rest of SQLite syntax works. In fact, I can't think of a time where I've actually used NOT LIKE except just now, which may explain the lameness of my example. Note: There must be better ways to phrase the above query. To find all names that begin with the letter J but do not have the letter e in them: SELECT * from baby_names WHERE name LIKE 'J%n' AND name NOT LIKE '%e%' The NOT keyword can be used to negate a LIKE operator, similar to what != is to =. Try running the previous query using % instead of _ to see the difference.


In other words, to get all names that begin with Zara, including just Zara: SELECT * FROM baby_names WHERE name LIKE 'Zara%' The percentage sign – % – is a stand-in for "zero-or-more characters". The true power of LIKE comes with the use of wildcards. case-insensitive): SELECT * FROM baby_names WHERE state LIKE 'ny' Using LIKE with wildcards Its functionality is similar too, though by default, LIKE will match English alphabet characters without regard to capitalization (i.e. In terms of syntax structure, it fits into a boolean expression just as an equals sign normally would: SELECT * FROM baby_names WHERE name LIKE 'Megan' The LIKE operator is used to match text string patterns. Using NOT IN to exclude multiple possibilities.

Using IN to match against multiple possibilities.
