Learn VisualLearn SQL

Building Up a Condition

A WHERE condition can combine tests with AND, OR, and NOT. BETWEEN a AND b covers an inclusive range, IN (…) checks membership in a list, and LIKE matches a text pattern where % stands for any run of characters.

GOAL

Build a compound WHERE condition and predict which rows pass.

SELECT * FROM products WHERE category_id IN (2, 3) returns how many rows?