mysql> select num,name from courses where name=.'语文';
+-----+--------+
| num | name |
+-----+--------+
| 2 | 语文 |
+-----+--------+
mysql> SELECT * from tutorials_tbl WHERE tutorial_author='Sanjay';
+-------------+----------------+-----------------+-----------------+
| tutorial_id | tutorial_title | tutorial_author | submission_date |
+-------------+----------------+-----------------+-----------------+
| 3 | JAVA Tutorial | Sanjay | 2007-05-21 |
+-------------+----------------+-----------------+-----------------+
| 6 | JAVA Tutorial | SANJAY | 2007-05-26 |
+-------------+----------------+-----------------+-----------------+
1 rows in set (0.01 sec)
mysql> SELECT * from tutorials_tbl WHERE BINARY tutorial_author='Sanjay'; //强制区分大小写
+-------------+----------------+-----------------+-----------------+
| tutorial_id | tutorial_title | tutorial_author | submission_date |
+-------------+----------------+-----------------+-----------------+
| 3 | JAVA Tutorial | Sanjay | 2007-05-21 |
+-------------+----------------+-----------------+-----------------+
mysql> select num,name from courses where num>2 AND num<5;
+-----+--------+
| num | name |
+-----+--------+
| 3 | 英语 |
| 4 | 化学 |
+-----+--------+
2 rows in set (0.00 sec)
mysql> select num,name from courses where NOT num>2;
+-----+--------+
| num | name |
+-----+--------+
| 1 | 数学 |
| 2 | 语文 |
+-----+--------+
2 rows in set (0.00 sec)
mysql> SELECT * FROM courses WHERE name LIKE '%文';
+-----+--------+-----------------+
| num | name | submission_date |
+-----+--------+-----------------+
| 2 | 语文 | 2018-01-30 |
+-----+--------+-----------------+
1 row in set (0.00 sec)