See? The query returned nothing. You must use
IS (NOT) NULL to check for
NOT NULL values. If you don't use it, the query will return nothing.
It's easy to remember that
x = NULL is wrong, but this phenomenon is much more difficult to notice with non-equality. Take a look at the column
production_area. If you want to get all the products which have been produced outside EU, you could write:
WHERE production_area != 'EU';
... but this query will not return those rows which have
NULL in the column
Is this correct? It depends. If you want to find all the products which have a set value which is other than
'EU', then the condition is OK. If you want to find all the rows with anything other than
NULLs), then we need to use the following construction:
WHERE production_area != 'EU'
OR production_area IS NULL;