Predict LIKE Match
Predict Output Easy
Question
Given emails: 'ada@x.com', 'bob@x.org', 'grace@x.com', how many rows match?
Code
SELECT COUNT(*) FROM users WHERE email LIKE '%.com';
Hint
LIKE '%.com' matches any string ending in '.com'.
Explanation
The pattern '%.com' matches any email ending in '.com'. Two emails ('ada@x.com' and 'grace@x.com') match, so the count is 2.
Related Resources
Related Lessons
- WHERE Clause
Learn LIKE.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.