SQLancer
←
LESSON 3

SQL (Core) - Queries with constraints (Pt. 2)

Progress: 0%

Queries with constraints (Pt. 2)

When writing WHERE clauses with text columns, SQL supports case-insensitive string comparison and wildcard pattern matching.

Operator Condition SQL Example
= Exact string comparison director = "John Lasseter"
!= or <> Exact string inequality comparison director != "John Lasseter"
LIKE Case-insensitive pattern matching title LIKE "Toy Story%"
% Wildcard matching zero or more characters title LIKE "%WALL-%"
_ Wildcard matching exactly one character title LIKE "WALL-_"

Wildcards Explained (% vs _)

The percent symbol (%) represents any sequence of characters of any length (including empty sequence). The underscore (_) represents exactly one single character.

🗄️ Schema Explorer SELECTABLE

› movies
|

🎯 Exercises Checklist:

☐ 1. Find all the Toy Story movies
☐ 2. Find all the movies directed by John Lasseter
☐ 3. Find all the movies (and director) not directed by John Lasseter
☐ 4. Find all the WALL-* movies
⚡ Practice Console

Data Output

No results. Run query to fetch data.

Current Task Target

5 rows