educative.io

LIKE operator is case sensitive?

In the course, it is written:
Note that the LIKE statement is case-sensitive. It shows different results for patterns “%M” and “%m”.

But what I have figured out is that it depends upon the collation of the column on which we are applying the LIKE operator. If the collation is set to cs (case-sensitive) then the LIKE operator will perform a case-sensitive filter and if it is set to ci (case-insensitive) then there will be a case-insensitive search.


Course: https://www.educative.io/collection/5352985413550080/6335716377231360
Lesson: https://www.educative.io/collection/page/5352985413550080/6335716377231360/5982697882124288

1 Like

Hi @ahmed_anwar
LIKE performs case-insensitive substring matches if the collation for the expression and pattern is case-insensitive and vice versa.

Hope it will help, Thanks :blush:

so please update that in the course, so it will help others :slight_smile:


Course: https://www.educative.io/collection/5352985413550080/6335716377231360
Lesson: https://www.educative.io/collection/page/5352985413550080/6335716377231360/6683698016550912

1 Like

Thanks for pointing this out. We’ll look into it, your feedback is much appreciated!

2 Likes

Just uploading it for making your search easy

1 Like