IS NOT NULL Check in SQL

Level 247 keystrokes

IS NOT NULL filters for rows that have a value in the column.

SQL code

1SELECT
-- Returns the name of each matching user
2 name
3FROM
4 users
-- Keeps users whose email has a value
5WHERE
-- IS NOT NULL is the opposite of IS NULL; email != NULL would match no row
6 email IS NOT NULL;

Output

+-------+
| name  |
+-------+
| Alice |
| Bob   |
| Carol |
+-------+
3 rows in set
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this SQL code and how often they appear.

  • ;× 1

More SQL examples at level 2

← SQL typing practice