Back to Course
SQL for Testers

Like Operator

Definition

The LIKE operator performs pattern matching on string values, using wildcard characters: % matches any sequence of characters, and _ matches exactly one character.

Examples

SELECT * FROM employees WHERE name LIKE 'A%';   -- starts with A
SELECT * FROM employees WHERE name LIKE '%son'; -- ends with son
SELECT * FROM employees WHERE name LIKE '_ohn'; -- 4 letters, ending in ohn

Why Testers Use It

LIKE is handy for verifying search and filter features, or for quickly finding all test data records that follow a particular naming pattern (e.g., WHERE name LIKE 'TEST_%').

Ready to master real-world software testing?

Learn manual and automation testing hands-on with mentor-led sessions.

Explore Course