SQL practicefor the classroom

Learn SQL by writing it.

Master SQL through interactive challenges. Write real queries against three databases — a music store, a wildlife rescue centre and a space research station — and get instant feedback on every attempt.

You’ll need a class code from your teacher to create an account.

CHALLENGE 10Level 2 · WHERE Clauses Correct

A fitness playlist is being curated. List the titles and durations of tracks longer than 300 seconds.

SELECT title, duration
FROM Tracks
WHERE duration > 300;
27 rows
titleduration
All Too Well329
Bloodstream308
Escape from LA320
After Hours361
… 23 more rows
How it works

Read it. Write it.
Get it right.

Every challenge comes with a lesson for its level, so students always know what to try next — and every query they run is checked straight away.

01

Read the lesson

Built-in lessons at every level explain the concept, show the format and walk through worked examples.

02

Write a real query

Each challenge is a small workplace brief. Students write the SQL themselves and run it against a live database.

03

Get instant feedback

A validator checks the result the moment it runs. Stuck? A hint points to the next step without giving the answer away.

The seven levels

124 practice challenges,
one step at a time.

Start with a single SELECT and work up to subqueries. Every level has challenges in both databases, so each new skill gets practised twice before the heat turns up.

LEVEL1Basic SELECT Statements7 music store6 wildlife rescue6 space research
LEVEL2WHERE Clauses6 music store6 wildlife rescue6 space research
LEVEL3ORDER BY and LIMIT5 music store6 wildlife rescue6 space research
LEVEL4Simple JOINs7 music store6 wildlife rescue6 space research
LEVEL5Aggregates and GROUP BY6 music store6 wildlife rescue6 space research
LEVEL6Multi-Table JOINs5 music store6 wildlife rescue6 space research
LEVEL7HAVING, Subqueries and Advanced Filtering4 music store6 wildlife rescue6 space research
Plus an open sandbox for trying queries without a brief.
Three databases

Three worlds to query.
The same SQL skills.

Students pick a database on the Challenges and Sandbox pages. The lessons teach each technique once; the three databases give students three different places to use it.

Database 01

Music Store

A small online music shop: artists from five countries, their albums and tracks, and the customers who buy them. Classic business data, perfect for learning how tables link together.

282tracks
20albums
20artists
15orders
Good for practising
  • SELECT and WHERE basics
  • Sorting with ORDER BY and LIMIT
  • Joining artists → albums → tracks
  • Revenue with SUM and GROUP BY
Challenge 30 · Level 5

You need to calculate revenue. Show the album title and the total revenue it has generated.

40 challenges across the seven levels

Tables
Artists
  • PKartist_id
  • name
  • FKcountry
Albums
  • PKalbum_id
  • title
  • release_year
  • FKartist_id
Tracks
  • PKtrack_id
  • title
  • duration
  • FKalbum_id
Genres
  • PKgenre_id
  • name
Customers
  • PKcustomer_id
  • first_name
  • last_name
  • email
Orders
  • PKorder_id
  • order_date
  • FKcustomer_id
  • total_amount
Order_Items
  • PKorder_item_no
  • FKorder_id
  • FKalbum_id
  • quantity
Countries
  • PKcountry_id
  • country_name

Plus two link tables, Artists_Genres and Albums_Genres, that connect artists and albums to genres.

View the Music Store schema
Database 02

Wildlife Rescue Centre

Help a rescue team manage animal admissions, habitats, care rosters and treatments — from koalas and echidnas to a green sea turtle. Messier, more realistic data with dates, gaps and costs.

13animals
6species
21treatments
6carers
Good for practising
  • Finding NULLs (still in care)
  • Date ranges with BETWEEN
  • Many-to-many JOINs
  • Spotting what’s missing with LEFT JOIN
Challenge 106 · Level 2

Prepare the current resident list. Show animal_id and animal_name for animals whose release_date is NULL.

42 practice challenges and 3 optional investigations

Tables
Animal_Groups
  • PKanimal_group_id
  • animal_group_name
Treatment_Types
  • PKtreatment_type_id
  • treatment_type_name
Roles
  • PKrole_id
  • role_name
Animals
  • PKanimal_id
  • animal_name
  • FKspecies_id
  • FKenclosure_id
  • admission_date
  • release_date
  • weight_kg
Species
  • PKspecies_id
  • species_name
  • FKanimal_group_id
  • conservation_status
Enclosures
  • PKenclosure_id
  • enclosure_name
  • habitat_type
  • capacity
Treatments
  • PKtreatment_id
  • FKanimal_id
  • FKcarer_id
  • treatment_date
  • FKtreatment_type_id
  • cost
Carers
  • PKcarer_id
  • first_name
  • last_name
  • FKrole_id
Care_Assignments
  • PKanimal_id
  • PKcarer_id
  • assigned_date

Care_Assignments links animals and carers many-to-many. A NULL release_date means the animal is still in care. All people and animals are fictional teaching data.

View the Wildlife Rescue Centre schema
Database 03

Space Research Station

Coordinate mission crews, research experiments and supply deliveries. Follow cargo from a delivery to the mission that receives it, and distinguish planned work from completed work.

5missions
10crew
12experiments
7supplies
Good for practising
  • Mission and experiment filters
  • Crew roles and assignments
  • Delivery mass calculations
  • Finding gaps with subqueries
Challenge 234 · Level 6

Calculate delivered cargo mass per mission, excluding planned and cancelled deliveries.

42 challenges, six in every level

Tables
Missions
  • PKmission_id
  • mission_name
  • launch_date
  • end_date
Crew
  • PKcrew_id
  • first_name
  • last_name
  • FKrole_id
Roles
  • PKrole_id
  • role_name
Experiments
  • PKexperiment_id
  • FKmission_id
  • FKlead_id
Assignments
  • PKmission_id
  • PKcrew_id
Supplies
  • PKsupply_id
  • supply_name
  • unit_mass_kg
Deliveries
  • PKdelivery_id
  • FKmission_id
  • status
Delivery_Items
  • PKdelivery_id
  • PKsupply_id
  • quantity

All data is fictional. Assignments record mission membership; experiment leads may provide remote support. Supply deliveries distinguish planned, delivered and cancelled cargo.

View the Space Research Station schema
For teachers

Built for the classroom, not just the student.

Set your class up in minutes, then see exactly how each student is thinking — not just whether they got there.

Class codes

Students join with a code you hand out, so only your class signs up.

Every submission, reviewable

The admin view shows the queries students actually wrote, right or wrong.

Progress by level

Students track their own journey; you can see who’s racing ahead and who needs a hand.

Contact

Send Ben a message

Use the form for project enquiries, speaking, collaboration, or anything else you want to send through directly. Messages are delivered to ben@benjaminhyde.com.au.