1.7

IS NULL, BETWEEN, IN Operators

IS NULL

Example:

SELECT name, IndepYear
FROM country
WHERE IndepYear IS NULL;

Results:

is_null.png

BETWEEN Operators


Example:

USE world;
SELECT name, IndepYear
FROM country
WHERE name BETWEEN "Aruba" and "Bahamas";


Results:

between.png

The IN Keyword


Examples:

USE world;
SELECT name
FROM country
WHERE name IN ('Aruba', 'Barbados', 'Cuba', 'Bahamas')
ORDER BY population ASC;

Results:

IN.png

CC BY-NC-ND International 4.0

CC BY-NC-ND International 4.0: This work is released under a CC BY-NC-ND International 4.0 license, which means that you are free to do with it as you please as long as you (1) properly attribute it, (2) do not use it for commercial gain, and (3) do not create derivative works.