← ACARA Digital Technologies Years 7–8

Modelling an object as a record

One row in a table that stores one object. Each attribute of the object becomes a field, so one pet's Name, Species and Age fill one record, and every record uses the same fields.

Understanding Modelling an object as a record in ACARA Digital Technologies Years 7–8

What it does: One INSERT adds one row, which stores one pet as one record. The query returns the same three fields for every pet record, showing that all records share the same fields. A record is a row of values for one pet. Name, Species and Age are the field names, which sit in the header. One object is one record. Putting two pets in one row breaks the rule of one object per row. The field is the column heading, such as Age. The value, such as 4, is stored in the record. The field list shows that each attribute of the pet object becomes one field in the table.

Common mistakes: Each field in CREATE TABLE must be separated from the next by a comma. 'Species TEXT' needs a comma after it so Age can be the next field: ' Species TEXT,'. A record must fill every field the table uses. This pet has a Name and Species but no Age value. It should be ('Milo', 'Dog', 3);.

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 331–360) and word search (Modules 331–411).

Take this worksheet further — free with Cloodit

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

Learning
Duo
A Pets table has the fields Name, Species and Age. How many records do you need to store 3 pets?
1 record that holds all 3 pets3 records, one row for each pet
Matches
Pets(Name, Species, Age) ('Milo', 'Dog', 4, 'Coco', 'Cat', 2)
↓
Two pets are crammed into one record. Each object needs its own record (row), so Milo and Coco should be two separate rows.
Applying
Meanings
Term
record
Meaning
One row in a table that stores one object. Each attribute of the object becomes a field, so one pet's Name, Species and Age fill one record, and every record uses the same fields.
Practice
INSERT INTO products (productId, name, category, price, stock)
Testing
Gaps
CREATE TABLE (Name, Species, Age);
Check Answer
Spots
2 Name TEXT,
3 Species TEXT

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

The 'Wolverine' badge — Fearless Coder, 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. A Pets table has the fields Name, Species and Age. How many records do you need to store 3 pets?
A. 3 records, one row for each pet ✓
B. 1 record that holds all 3 pets
One object is stored as one record. Three pets means three records, so three rows.
2. Which one is a record in the Pets table?
A. Biscuit, Dog, 4 ✓
B. Name, Species, Age
A record is a row of values for one pet. Name, Species and Age are the field names, which sit in the header.
3. When we model a pet as a record, what does each attribute of the pet become?
A. A field ✓
B. A new table
Each attribute (Name, Species, Age) becomes a field. The pet itself becomes one record.
4. Mia stores her cat in the Pets table as: Whiskers, Cat, 2. Which is the correct way to describe this?
A. Three records with 1 value each
B. One record with 3 field values ✓
All three values describe the same pet, so they sit together in one record.
5. Every record in the Pets table must use...
A. Different fields depending on the pet
B. The same fields: Name, Species and Age ✓
Every record in a table has the same fields. Only the values change from pet to pet.

Match the Pairs

Pets(Name, Species, Age) → A Pets table where each attribute of a pet becomes a field: Name, Species and Age
('Milo', 'Dog', 4) → One record: one pet stored as a row, with one value for each field
Each pet is one object, so it is stored as one row (record) in the table → INSERT INTO Pets VALUES ('Coco', 'Cat', 2);
Every record in the Pets table uses the same fields, so each row has a Name, a Species and an Age → SELECT Name, Species, Age FROM Pets;
Pets(Name, Species, Age) ('Milo', 'Dog', 4, 'Coco', 'Cat', 2) → Two pets are crammed into one record. Each object needs its own record (row), so Milo and Coco should be two separate rows.
Pets(Name, Species) ('Milo', 'Dog', 4) → The record has a value for Age but the table has no Age field. Every attribute of the pet needs its own field, so Age must be added to the table.

Key Term

record
One row in a table that stores one object. Each attribute of the object becomes a field, so one pet's Name, Species and Age fill one record, and every record uses the same fields.

Fill in the Blanks

1. CREATE TABLE Pets (Name, Species, Age);
Hint: Type the table name that will hold one record for each pet.
2. INSERT INTO Pets VALUES ('Rex', 'Dog', 3);
Hint: Type the keyword that adds a new record (one pet) to the table.
3. SELECT Name, Species, Age FROM Pets;
Hint: Type the field that stores what kind of animal each pet is.
4. SELECT Name, Age FROM Pets;
Hint: Type the keyword that says which table the records are read from.
5. INSERT INTO Pets VALUES ('Rex', 'Dog', 3); INSERT INTO Pets VALUES ('Tom', 'Cat', 2);
Hint: Type the keyword that introduces the field values for the second pet's record, matching the first line.

Spot the Error

Question 1
A CREATE TABLE Pets (
B Name TEXT,
C Species TEXT
D Age INTEGER
E );
Line C — Each field in CREATE TABLE must be separated from the next by a comma. 'Species TEXT' needs a comma after it so Age can be the next field: ' Species TEXT,'.
Question 2
A INSERT INTO Pets
B (Name, Species, Age)
C VALUES
D ('Milo', 'Dog');
Line D — A record must fill every field the table uses. This pet has a Name and Species but no Age value. It should be ('Milo', 'Dog', 3);
Question 3
A INSERT INTO Pets
B (Name, Species, Age)
C VALUES ('Luna', 5, 'Cat');
Line C — Values must be in the same order as the fields listed. Species comes before Age, so the values should be ('Luna', 'Cat', 5).
Question 4
A SELECT Name, Species, Age
B FROM Pet
C WHERE Species = 'Dog';
Line B — The table is called Pets, not Pet. The query must name the table that stores the pet records: FROM Pets.
Question 5
A SELECT Name, Species
B FROM Pets
C WHERE Name = Milo;
Line C — Name is a text field, so the value Milo must be in quotes. Without quotes, SQL thinks Milo is a field name. It should be WHERE Name = 'Milo';

Student with a class code? Join your class →