How does NOT Between function works in SQL?

MySQL NOT BETWEEN AND operator checks whether a value is not present between a starting and a closing expression. If expr is not greater than or equal to min and expr is not less than or equal to max, BETWEEN returns 1, otherwise, it returns 0.

Syntax:

expr NOT BETWEEN min AND max

Example: The following MySQL statement will fetch the rows from the table publisher which established before 1968 or after 1975. The NOT operator is used to exclude the publishers which ware established within the given period.

Code:

SELECT pub_name,country,pub_city,estd
FROM publisher
WHERE YEAR(estd)  NOT BETWEEN 1968 AND 1975;

Sample Output:

mysql> SELECT pub_name,country,pub_city,estd
    -> FROM publisher
    -> WHERE YEAR(estd)  NOT BETWEEN 1968 AND 1975;
+------------------------------+---------+-----------+------------+
| pub_name                     | country | pub_city  | estd       |
+------------------------------+---------+-----------+------------+
| BPP Publication              | India   | Mumbai    | 1985-10-01 | 
| Ultra Press Inc.             | UK      | London    | 1948-07-10 | 
| Summer Night Publication     | USA     | New York  | 1990-12-10 | 
| Pieterson Grp. of Publishers | UK      | Cambridge | 1950-07-15 | 
| Novel Publisher Ltd.         | India   | New Delhi | 2000-01-01 | 
+------------------------------+---------+-----------+------------+
5 rows in set (0.04 sec)