MySQL query is the core function of MySQL. Sometimes we need to find tables with matching letters. The following describes the MySQL query method for your reference.
In MySQL, we can use the LIKE or not like operator for comparison. In MySQL, the mode is case-insensitive by default.
Query example: student table
+ -------- + --------- + ------- + --------------- + --------- +
| Studid | name | marks | address | phone |
+ -------- + --------- + ------- + --------------- + --------- +
Mysql> select * from student where name like'm % ';
Lists the names of all students whose names start with M in the student table.
Mysql> select * from student where name like '% E ';
Lists All student names ending with the letter e.
Mysql> select * from student where name like '% a % ';
Lists student names that contain any specific letter anywhere. The following query example lists the student names that contain the letter ".
Mysql> select * from student where name like '_____';
If the name we are looking for contains five letters, we can use the special letter "_" underline ). The student table contains the names of five students.
MySQL query cache Variables
How to optimize MySQL Query
Five useful methods for MySQL Query Optimization
Design efficient and reasonable MySQL query statements
MySQL Query Optimizer