MicrolearnENPTES

Text patterns with LIKE

Lesson 7 of 24 · SQL.Micro

LIKE matches text against a pattern: % stands for any number of characters, _ for exactly one.

LIKE 'A%' starts with A; LIKE '%son' ends with son; LIKE '%data%' contains data.

In SQLite, LIKE ignores upper/lower case for plain letters.

Patterns starting with % are slow on big tables: indexes cannot help.

Check yourself

Which pattern finds names with exactly 4 letters?

Show the name of every customer whose name starts with A.

Do it in the browser: a real SQL tool, a short mission and instant feedback. No install.

Start this lesson — free
← IN and BETWEENMissing values: NULL →

All lessons · SQL.Micro