Answering a question with a multi-table query
A query that gets fields from more than one table: find which tables hold them, JOIN them on matching keys, then add WHERE and ORDER BY to match the question.
Understanding Answering a question with a multi-table query in ACARA Digital Technologies Years 9–10
What it does: memberId in loans is the foreign key that points to the primary key memberId in members, so this ON condition matches each loan to its member. The teacher's name is in the teachers table, so the query must join it. Without the JOIN, teachers.name is not available from the classes table. ON links the tables using the keys. WHERE filters the joined rows to match the question, for example WHERE members.firstName = 'Ava'. ORDER BY sorts the output rows. The question asks for the loans to be in date order, so add ORDER BY at the end of the query.
Common mistakes: The join must follow the foreign key. loans.memberId is the foreign key that matches members.memberId, not loans.loanId. The ON line should be ON m.memberId = l.memberId. The foreign key in classes is teacherId, so it must be matched to the primary key teachers.teacherId. classId is the wrong field. It should be ON c.teacherId = t.teacherId.
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
multi-table queryFill in the Blanks
Spot the Error
Student with a class code? Join your class →