Problem Statement
Describe how LIKE works with % and _ wildcards. When should you avoid it?
Explanation
Percent matches any sequence of characters, including empty. Underscore matches exactly one character. Anchoring at the end, like 'abc%', can use indexes; leading wildcards like '%abc' usually force scans.
Use LIKE for simple patterns. For heavy text search or complex rules, prefer full text indexes or regex features to keep queries fast and precise.
Code Solution
SolutionRead Only
SELECT * FROM students WHERE first_name LIKE 'K%'; SELECT * FROM students WHERE first_name LIKE '__K%';
