mysql> select10 between 10 and 20, 9 between 10 and 20;
+----------------------+---------------------+
| 10 between 10 and 20 | 9 between 10 and 20 |
+----------------------+---------------------+
| 1 | 0 |
+----------------------+---------------------+
1 row in set(0.01 sec)
mysql> select not 0, not 1, not null;
+-------+-------+----------+
| not 0 | not 1 | not null |
+-------+-------+----------+
| 1 | 0 | NULL |
+-------+-------+----------+
1 row in set(0.00 sec)
1
2
3
4
5
6
7
mysql> select(1 and 1), (0 and 1), (3 and 1), (1 and null);
+-----------+-----------+-----------+--------------+
| (1 and 1) | (0 and 1) | (3 and 1) | (1 and null) |
+-----------+-----------+-----------+--------------+
| 1 | 0 | 1 | NULL |
+-----------+-----------+-----------+--------------+
1 row in set(0.00 sec)
1
2
3
4
5
6
7
mysql> select(1 or 0), (0 or 0), (1 or null), (1 or 1), (null or null);
+----------+----------+-------------+----------+----------------+
| (1 or 0) | (0 or 0) | (1 or null) | (1 or 1) | (null or null) |
+----------+----------+-------------+----------+----------------+
| 1 | 0 | 1 | 1 | NULL |
+----------+----------+-------------+----------+----------------+
1 row in set(0.00 sec)