strawquery PT
All lessons

Lesson 3 of 30

Filtering with numbers

Today at the studio

Rin, the producer, has a budget meeting at noon and needs numbers fast. "Not everything," she says. "Only the rows that matter." Kou's note on your screen now has a second line: "WHERE is your friend."

The idea

WHERE keeps only the rows that pass a test. For numbers you can compare with =, >, <, >=, <= and <> (not equal).

The filter runs on each row before the result is built. Rows where the test is false, or unknown because the value is missing, are left out.

Example

SELECT name, floor FROM departments WHERE floor >= 2

Your turn

0 of 4 questions

Question 1 of 4

Which shows premiered after 2022? Show title and premiere_year.

Unofficial fan project. Titles belong to their creators and rights holders.