Sql Like operator

The LIKE operator is used to compare similar values using wildcard operators.Wildcard operators are the percent sign ( % ) and the underscore ( _ ). The percent sign ( % ) represents multiple characters whereas the underscore ( _ ) represents single character.
Syntax is as:
SELECT * FROM table_name WHERE column_name LIKE {pattern} 

As in example we have table employees
id first_name last_name salary city
1 Johan Sumith 200000 Delhi
2 Ansh Kumar 300000 Mumbai
3 Sameer Seth 100000 Delhi
4 Pyush 250000 Kolkata
5 Shikha Anand 160000 Chandigarh
6 Rajeev Khatri 450000 Chennai
7 Ram Kumar 540000 Amritsar
8 Ritu Sharma 500000 Sonepat
9 Deepika Verma 360000 Chandigarh
10 Kuldeep Singh 270000 Simla


We want to find employees whose first name starts with Ra.
SELECT * FROM table_name WHERE first_name LIKE 'Ra%'

We get
id first_name last_name salary city
6 Rajeev Khatri 450000 Chennai
7 Ram Kumar 540000 Amritsar
Now we want to find employees whose last name has first letter anything and second place has h.
SELECT * FROM table_name WHERE last_name LIKE '_h%'

We get
id first_name last_name salary city
6 Rajeev Khatri 450000 Chennai
8 Ritu Sharma 500000 Sonepat