The use of the LIKE operator is primarily used for wildcard searches in order to filter the data in a complex way.
Use wildcard characters to create a search pattern that compares specific data.
Percent percent (%) wildcard character
% indicates any number of occurrences of any character.
SELECT column name 1, column name 2 from table name WHERE column name 1 like condition (with one or more%);
% can match 0, one or more characters.
Underline (_) wildcard characters
The underscore _ matches only a single character instead of multiple characters.
SELECT column name 1, column name 2 from table name WHERE column name 1 like condition (containing _);
The underscore _ always matches one character and cannot be more or less.
Wildcard searches typically take longer to process than the other searches discussed earlier.
Tips for using wildcard characters:
1. Do not overuse wildcard characters
2. Try not to use wildcard characters at the beginning of the search pattern
3. Pay close attention to the position of the wildcard character
[MySQL] Filter with wildcards