← ACARA Digital Technologies Years 9–10

Entity relationship diagram: entities and relationship lines

An entity relationship diagram draws each entity as a labelled box and each relationship as a line joining two boxes. Boxes list attributes, with PK and FK marked.

Understanding Entity relationship diagram: entities and relationship lines in ACARA Digital Technologies Years 9–10

What it does: The line between the two boxes shows that the entities are related. Here, students are linked to the orders they place. Each entity (like Student or Product) is drawn as a labelled box. Lines are used for relationships, not entities. Attributes such as firstName and points are listed inside the box of the entity they describe. The line is for labelling the relationship. PK means primary key, the attribute that uniquely identifies each record. FK marks a foreign key. studentId in Orders points to the primary key of another table, so it is a foreign key and is marked FK. The PK of Orders would be orderId.

Common mistakes: FK marks a field that links to another table's primary key. firstName is an ordinary attribute, so it needs no mark. Only houseId should be marked FK. One student can have many results, so the 1 goes on the Student end and the * on the Result end. The line should be Student 1--* Result : sits.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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 433–451) and word search (Modules 413–451).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
In an ERD, how is each entity drawn?
As a line between two shapesAs a labelled box
Matches
[students] [orders] (two boxes with no line between them)
↓
There is no relationship line, so the ERD does not show that students and orders are related. Draw a line joining the two boxes.
Applying
Meanings
Term
ERD
Meaning
An entity relationship diagram draws each entity as a labelled box and each relationship as a line joining two boxes. Boxes list attributes, with PK and FK marked.
Practice
[students]
Testing
Gaps
studentId
Check Answer
Spots
2 studentId PK
3 firstName FK

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Woodpecker' badge — Tap Tap Tap, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. In an ERD, how is each entity drawn?
A. As a labelled box ✓
B. As a line between two shapes
Each entity (like Student or Product) is drawn as a labelled box. Lines are used for relationships, not entities.
2. What does a line joining two boxes in an ERD show?
A. A copy of the data from one table to another
B. A relationship between the two entities ✓
The line shows that the two entities are related, for example a Student places an Order. It does not copy any data.
3. Where are attributes written in an ERD?
A. Listed inside the entity's box ✓
B. Written on the relationship line
Attributes such as firstName and points are listed inside the box of the entity they describe. The line is for labelling the relationship.
4. Which label marks the primary key attribute in an entity box?
A. PK ✓
B. FK
PK means primary key, the attribute that uniquely identifies each record. FK marks a foreign key.
5. In the Orders box, studentId links back to the Students table. How should it be marked?
A. PK
B. FK ✓
studentId in Orders points to the primary key of another table, so it is a foreign key and is marked FK. The PK of Orders would be orderId.

Match the Pairs

[students] box with studentId PK, firstName, house → One entity drawn as a labelled box, with its attributes listed inside and the primary key marked PK
[results] box with studentId FK, subjectId FK, mark → An entity box where the FK marks show which fields link to other tables
A relationship is drawn as a line joining two entity boxes → [students] ------ [orders]
The relationship line is labelled with a verb that says how the entities connect → [students] --places-- [orders]
[students] [orders] (two boxes with no line between them) → There is no relationship line, so the ERD does not show that students and orders are related. Draw a line joining the two boxes.
[orders] box with studentId PK and productId PK → The foreign key fields are marked PK. They link to other entities, so they should be marked FK. The orders box needs its own PK, such as orderId.

Key Term

ERD
An entity relationship diagram draws each entity as a labelled box and each relationship as a line joining two boxes. Boxes list attributes, with PK and FK marked.

Fill in the Blanks

1. [Student] studentId PK firstName
Hint: Type the short marker that shows the primary key inside the box.
2. [Result] studentId FK mark
Hint: Type the short marker for a field that links to another table's primary key.
3. [Student] --- [Result]
Hint: Type the symbols that draw the relationship line joining the two boxes.
4. label = "places" [Student] --places-- [Order]
Hint: Type the word that names the relationship, as shown on the line above.
5. Entity: Student [Student] studentId PK
Hint: Type the entity name that labels the box.

Spot the Error

Question 1
A [Student]
B studentId PK
C firstName FK
D houseId FK
Line C — FK marks a field that links to another table's primary key. firstName is an ordinary attribute, so it needs no mark. Only houseId should be marked FK.
Question 2
A [Student]
B [Subject]
C [Result]
D Student *--1 Result : sits
E Subject 1--* Result : has
Line D — One student can have many results, so the 1 goes on the Student end and the * on the Result end. The line should be Student 1--* Result : sits.
Question 3
A [Result]
B resultId PK
C mark
D studentId PK
E Student 1--* Result : sits
Line D — In the Result box, studentId points back to the Student table, so it is a foreign key. The Result's own primary key is resultId. The line should be studentId FK.
Question 4
A [Order]
B orderId
C studentId FK
D productId FK
Line B — The attribute that uniquely identifies each order must be marked PK in the box. The line should be orderId PK.
Question 5
A [lastName]
B teacherId PK
C lastName
Line A — Each box is labelled with the entity name, not an attribute. lastName belongs inside the box. The label should be [Teacher].

Student with a class code? Join your class →