Assume the following tables:
CREATE TABLE X (x_name VARCHAR(100));
CREATE TABLE Y (y_name VARCHAR(100));
INSERT INTO X VALUES ('blue');
INSERT INTO X VALUES ('red');
INSERT INTO Y VALUES ('blue');
Resulting in:
+---------+        +---------+
| Table X |        | Table Y |
+---------+        +---------+
|  x_name |        |  y_name |
+---------+        +---------+
|  'blue' |        |  'blue' |
|   'red' |        +---------+
+---------+
The results of the following queries are as expected:
- SELECT * FROM X WHERE x_name IN (SELECT y_name FROM Y);will return one row- | 'blue' |.
- SELECT * FROM X WHERE x_name NOT IN (SELECT y_name FROM Y);will return one row- | 'red' |.
Let's insert NULL into table Y:
INSERT INTO Y VALUES (NULL);
The first query will return the same result (blue). However, the second query from above will return no rows. Why is this?
 
    