📁 Paper 1 · 3.2 Programming
3.2.6a Records — Structured Data Types
AQA 8525 · GCSE Computer Science · ~10 min read
Notes
──
Video
──
Worksheet
──
Quiz

What is a Record?

A record is a data structure that groups related data items of different types under one name. Each item in a record is called a field and has its own name and data type.

Unlike arrays (which store items of the same type), records can mix integers, strings, booleans, and reals in one structure.

StructureElement accessTypes of dataUse case
ArrayIndex (e.g. scores[0])All the same typeList of similar items
RecordField name (e.g. student.name)Mixed types allowedGrouped related data

Declaring a Record in AQA

AQA does not have a specific keyword for records in pseudo-code, but you can represent them conceptually. The idea is that a record has named fields:

// Conceptual record definition — "Student" with 3 fields // Field: name (String), age (Integer), isPassing (Boolean) student.name ← "Alice" student.age ← 15 student.isPassing ← True OUTPUT student.name // "Alice" OUTPUT student.age // 15

Accessing and Updating Fields

You access a record's field using dot notation: recordName.fieldName

product.name ← "Laptop" product.price ← 799.99 product.stock ← 50 // Update a field product.stock ← product.stock - 1 OUTPUT product.name + " costs £" + str(product.price)

Arrays of Records

A powerful pattern is an array of records — you can store multiple records in an array, then access each one by index and each field by name.

// Array of student records (index 0 to 2) students[0].name ← "Alice" students[0].age ← 15 students[1].name ← "Bob" students[1].age ← 16 students[2].name ← "Cara" students[2].age ← 15 // Print all student names with a loop FOR i ← 0 TO 2 OUTPUT students[i].name ENDFOR

Worked Example — Library System

// Book record: title, author, pages, isAvailable books[0].title ← "Python Basics" books[0].author ← "J. Smith" books[0].pages ← 320 books[0].isAvailable ← True books[1].title ← "Data Structures" books[1].author ← "K. Lee" books[1].pages ← 450 books[1].isAvailable ← False // Check out a book IF books[0].isAvailable == True THEN books[0].isAvailable ← False OUTPUT "Book checked out" ELSE OUTPUT "Not available" ENDIF
Exam tip: Records and arrays are both data structures, but records group related data of different types using field names, while arrays store multiple values of the same type using integer indices. Know the difference and when to use each.
⚠️ Common Mistakes
  • Confusing array index with field name — it's students[0].name not students["name"][0]
  • Forgetting that arrays are zero-indexed — first record is at index 0
  • Trying to store different data types in a plain array (use a record instead)
Video coming soon

Key points

  • Records store related data of different types using named fields
  • Dot notation accesses fields: record.fieldName
  • Arrays of records combine both structures for real-world data
  • Unlike arrays, records can mix strings, integers, booleans
Click slide or press arrow keys to navigate
✍️

Worksheet — 3.2.6a Records

8 questions · 19 marks

Q1State TWO differences between an array and a record.[2]
✅ Mark scheme
Mark scheme
Any two from: arrays use integer indices / records use named fields [1]; arrays store same data type / records store mixed types [1]; arrays suit lists of similar items / records suit grouped related data [1] — max 2.
Q2Write pseudo-code to store a car with fields: make (string "Ford"), year (integer 2022), price (real 18999.99).[3]
✅ Mark scheme
Mark scheme
car.make ← "Ford" [1]; car.year ← 2022 [1]; car.price ← 18999.99 [1].
Q3How do you access the 'age' field of a record called 'person'?[1]
✅ Mark scheme
Mark scheme
person.age [1] — dot notation with record name, dot, field name.
Q4An array 'students' holds 5 student records (index 0–4). Each has a 'grade' field. Write a FOR loop to output all 5 grades.[3]
✅ Mark scheme
Mark scheme
FOR i ← 0 TO 4 [1]; OUTPUT students[i].grade [1]; ENDFOR [1].
Q5Give a real-world scenario where using a record is more appropriate than a 1D array. Justify your answer.[2]
✅ Mark scheme
Mark scheme
e.g. Storing a patient's name, age, and blood pressure together [1]; because these are different types (string, integer, real) so a record with named fields is suitable, whereas an array requires the same type [1].
Q6A 'book' record has fields: title, author, isAvailable. Write code to output the book's title only if it is available.[3]
✅ Mark scheme
Mark scheme
IF book.isAvailable == True THEN [1]; OUTPUT book.title [1]; ENDIF [1].
Q7What will be output? students[2].name ← "Eve" students[2].score ← 95 OUTPUT students[2].name + " scored " + str(students[2].score)[2]
✅ Mark scheme
Mark scheme
"Eve scored 95" [2] — 1 mark if 'Eve' or '95' present but concatenation wrong.
Q8Write pseudo-code to update the price field of products[3] to 29.99, then output "Updated."[3]
✅ Mark scheme
Mark scheme
products[3].price ← 29.99 [2]; OUTPUT "Updated." [1].
Check your answers above.
Topic Quiz
Q 1 of 10
You scored
out of 10
Card 1 of 5
Click to flip
🎉
All done!
TermDefinition
🎯

Mini Test — 3.2.6a Records

Timed exam conditions.

  • 8 questions · 10 minutes
  • 5 MCQ + 3 short answer
← 3.2.4/5 Relational & Boolean
16 of 57 · AQA 8525
3.2.6b 2D Arrays →