Why a query over two tables needs a join
A join matches each foreign key value in one table to the primary key value in another, so rows from both tables show together. Rows with no match are left out.
Understanding Why a query over two tables needs a join in ACARA Digital Technologies Years 9–10
What it does: The JOIN pulls the name from customers and the total from orders in one result. The ON condition links the foreign key in orders to the primary key in customers. A join only reads and matches data. It never changes or deletes rows in the tables. Storing the name once avoids repeated data. The foreign key and a join let you bring the name back whenever you need it. The orders table stores the foreign key customer_id, so the name must be looked up in another table.
Common mistakes: The join must bring in the orders table, which holds customer_id and total. Joining customers to itself matches nothing useful. It should be JOIN orders o. The orders table only holds customer_id. The customer's name lives in the customers table, so it must be selected as c.name after the join.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 459–475) and word search (Modules 459–534).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
JOINFill in the Blanks
Spot the Error
Student with a class code? Join your class →