LIKE

SQL LIKE Keyword

The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. It is commonly used with the following wildcards:

  • % – represents zero, one, or multiple characters
  • _ – represents a single character

Tutorials dojo strip

SQL LIKE Syntax

SQL

SQL LIKE Patient Names Starting with “A” Example

This query selects all patients whose first_name starts with the letter “A”.

SQL

SQL LIKE Patient Names Ending with “a” Example

This query selects all patients whose first_name ends with the letter “a”.

SQL

SQL LIKE Doctor Specialties Containing “gen” Example

This query selects all doctors whose specialty contains the substring “gen” if there is any.

SQL

SQL LIKE Patient Names with Pattern “J__n%” Example

This query selects all patients whose first names start with “J”, followed by any two characters, and then any number of characters.

SQL

SQL LIKE Labs

Tutorials dojo strip