Simplify DB query with "COLLATE nocase" instead of "LIKE" and "substr"

Nocase comparation with "LIKE" and "substr" DB query can be changed to
"COLLATE nocase" on SQLite.

Change-Id: I66e4e22758d1cf8fbb3e3e3eb3920576eb61d93d