A table of 12 first names with the 6 matches marked Yes, beside the pattern LIKE '[a-m]%z' split into three parts: one letter from a to m, any run of characters, and a final z

Querying Pattern Ranges With LIKE: A Wildcard Puzzle With the Answer

Querying pattern ranges with LIKE takes the % wildcard and a range in square brackets. This puzzle asks which of six queries finds every first name that starts with a letter from A to M and ends with z. The answer is tested on a small Members table, along with the = trap, the NOT range and a collation trap. Every result comes from SQL Server 2025.

Read More