One-to-many relationships between tables
One record in a primary table matches many records in a related table. The foreign key sits on the many side, e.g. one class has many students, so class details are not repeated.
Understanding One-to-many relationships between tables in VCE Data Analytics U3O1
What it does: Students is the many side, so it holds the ClassID foreign key that references the primary key in Classes. The teacher is stored once in Classes and the JOIN brings it back for each student using the foreign key, so the data is not repeated. One class record matches 24 student records, which is the pattern of a one-to-many relationship. The 1 marks the one side and the crow's foot (<) marks the many side, so this notation shows a one-to-many relationship.
Common mistakes: To see how many students are in each class, count the matching rows on the 'many' side with COUNT(*). SUM(*) is not valid. It should be SELECT ClassID, COUNT(*). ClassID in Student is a foreign key, not a primary key. If it were a primary key, each class could only appear once, so a class could only have one student. It should be ClassID INT, so many students can share a ClassID.
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 17–49) and word search (Modules 17–91).
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
one-to-many relationshipFill in the Blanks
Spot the Error
Student with a class code? Join your class →