Skip
Arish's avatar

48. Practice - More LIKE Patterns


Exercise: Ending Pattern

Find students whose names end with 'n'.

Solution

sql
1SELECT * FROM students
2WHERE name LIKE '%n';

Single Character Wildcard

The underscore _ matches exactly one character:

sql
1-- Names with 4 characters
2SELECT * FROM students
3WHERE name LIKE '____';