Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Returning all data from a table
Select some columns
Filtering rows
Logic
Text patterns
To be or NULL to be
20. Looking for NULL values
A bit of mathematics
Let's practice

Instruction

Great! Remember, NULL is a special value. You can't use the equals operator to check whether something is NULL. It simply won't work. The opposite of IS NOT NULL is IS NULL.

SELECT
  Id
FROM User
WHERE MiddleName IS NULL;

This query will return only those users who don't have a middle name (i.e., their MiddleName is unknown).

Exercise

Select all cars with an unknown price.

Stuck? Here's a hint!

Type:

SELECT
  *
FROM Car
WHERE Price IS NULL;