Queries with several conditions

About this lesson: Queries with several conditions

In short

A query finds records that match conditions. With AND, both must be true; with OR, either is enough. Change the year and rating and switch between AND and OR.

Queries with several conditions

What you'll explore

AND and OR: Both, or either?
A query finds records that match conditions. With AND, both must be true; with OR, either is enough.
Across two tables: JOIN, then filter
Which students scored highly in Science? Names are in one table and scores in another. The query joins them on StudentID, then filters.
Write the query: From words to conditions
Each part of a question becomes a condition. Look at three questions and their WHERE clauses.
Check yourself: AND or OR?
You want films that are both a comedy and shorter than 100 minutes.

Also in this lesson

  • Common mix-ups
  • Examples
  • Card query

Words to know

query
A request for data that matches conditions.
condition
A test such as Year > 2018.
AND
Both conditions must be true.
OR
At least one condition must be true.
JOIN
Combining related tables in a query.

Sources

  • BBC Bitesize KS3 Computer Science
  • Raspberry Pi Foundation, Computing curriculum resources

An interactive lesson with a live experiment: move the sliders, press the buttons and answer quick questions. 4 short steps and a 6-question quiz. Part of the Family plan. Written and checked by Shalo Lab. Last updated 11 November 2026.

Big Data →

All lessons in Term 3 · Computing · Age 13