WeCodeAcademy

LIKE and NULL

LIKE matches text patterns: % stands for any run of characters and _ for exactly one.

Examplesql
Open in editor »

NULL means "no value". You cannot test it with =; use IS NULL or IS NOT NULL. Here we add a customer with no city to see it.

Examplesql
Open in editor »

The last query returns nothing: nothing ever equals NULL.

Quick check

How do you find rows where `city` has no value?

Your turn: write the code

Return the names of customers whose name ends with the letter e, sorted by name.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.