Español

For teachers · 50 minutes

← Ready-to-teach lessons

SELECT and WHERE lesson

A first SQL class in 50 minutes: from the arcade to writing filters with AND, OR and exact text. With a printable worksheet.

Goal

Every student can ask for columns, filter rows with one or more conditions and sort the result.

Lesson plan

0–5 minIntroduce the topic on the board with one example query.
5–20 minArcade, in pairs or alone. Arcade world 1: The Scanner, Query Invaders, Double Cannon and the boss, The NULL Ghost.
20–35 minWorksheet: six questions on the same tables.
35–45 minCase: Case 00, "The First Query": one table, one WHERE and a time.
45–50 minClass discussion with the questions below. Whoever beat the boss hands in their certificate code.

Materials

SQL arcadeArcade world 1: The Scanner, Query Invaders, Double Cannon and the boss, The NULL Ghost. Open the caseCase 00, "The First Query": one table, one WHERE and a time.

Mistakes you'll see

For the class discussion

Evidence

When a student beats a boss, the arcade gives a certificate with a code. Ask for it as the submission and check it here: check codes →

Student worksheet

Ready to print, no answers.

Worksheet PDF
SQL ARCADE
Name: ______________________________Date: ____________

SELECT and WHERE lesson

suspects
idnameagecityjob
1Lucía Prado34Lumen Bayphotographer
2Joel Ibarra52Salt Harborlocksmith
3Marta Solís27Lumen Baynurse
4Iker Vela41San Cirotaxi driver
5Rocío Andrade63Salt Harborjeweler
6Damián Cuevas19San Cirocourier
7Elena Ruiz46Lumen Bayaccountant
8Bruno Paz38Salt Harbormechanic
  1. The name and city of every suspect.
  2. All columns for suspects older than 40.
  3. The name of those who live in Salt Harbor.
  4. The name of those who live in Salt Harbor and are under 50.
  5. The name of those who live in Lumen Bay or San Ciro.
  6. The name and age of the three oldest suspects, oldest first.

casoabiertogame.com · SQL arcade and detective cases, free for the classroom

Want the answer key?

The worksheet answers and the solutions to all 28 cases aren't published, so students won't find them. Write to us from your institutional email and we'll send them, at no cost.

Request the answer key

The arcade, the lessons and the first two cases are free and need no account. For your group to have all 28 cases, the classroom license is free too: how to request it →