GCSE · Computer Science · OCR · Spec J277
Records
Your game needs to remember a username, a password and a top score for each player. Three separate scraps of data, or one neat bundle?
Computer Science · Records
Sort the player's record
A game stores a record about one player. Sort each item: is it the entity, an attribute (field), or the data?
Still to sort
Entity (0)
The single object, place, person or thing the record is about.
Where the line is: The entity is what the record describes. It is not one of the properties and not a stored value.
Attribute (field) (0)
A property or characteristic of the entity. Also called a field.
Where the line is: An attribute is the name of the property. The actual value stored under it is the data.
Data (0)
The actual value stored for an attribute.
Where the line is: Data is the value itself, such as a name typed in or a score reached.
Every item here belongs to exactly one job.
Predict, then check
Your game now has lots of players, and Python has no native record.
How could a program store the records for many players?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
What you need to know
- Data structures store data in an organised and accessible way, and a record is one example.
- A record collects the attributes of a single entity.
- An entity is a single object, place, person or thing, such as a player, a customer, a book or a car.
Have a goA shop stores information about each of its customers. Is 'a customer' the entity, an attribute or the data?
The entity.
A customer is a single person the record is about, not a property of something else or a stored value.
- Attributes are the properties or characteristics of an entity, and are sometimes called fields.
- In a player record, the player is the entity, username, password and top score are the attributes, and "rockstar9", "6goatsEating" and 5,328 are the data.
Have a goYour mate Sam says 5,328 is an attribute because it is a number. Convince him otherwise in one sentence.
5,328 is data. The attribute is top score.
An attribute is the property, and the data is the actual value stored under it.
- When a record is declared, each attribute and its data type, such as string or integer, is determined and then fixed.
- A record is a static data structure, so its size is fixed at declaration and does not change.
Have a goSomeone declares a Player record, then wants to give one player's record an extra attribute. Does the record's size change?
No. The size is fixed at declaration.
A record is a static data structure, unlike a list that you can keep adding to.
- In pseudocode you declare a record by listing each attribute with its data type.
- A database holds many records for one entity, all with the same attributes but different data.
- Python has no native record, so a dictionary of key-and-data pairings can be used, with each key identifying an attribute.
The big picture
A record is a data structure that collects the attributes of one entity, such as a player. The player is the entity, username, password and top score are the attributes, and values like "rockstar9" and 5,328 are the data. Attributes and their data types are decided when the record is declared and then stay fixed, so every record has the same structure with different data. In Python a dictionary, with a key for each attribute, can represent a record, and a list of dictionaries can hold many.
Key points
Worked example
Problem
A shop keeps a record for each customer. One record holds: name "Priya", membership "Gold", points 120. Identify the entity, the attributes and the data, and choose a data type for each attribute.
⚠ Watch out
Treating a record like a list you can keep adding to. A record's attributes and their data types are fixed when it is declared, and every record of that type has the same structure.
Memory hook
Entity = who. Attributes = what we store. Data = the actual values.
Check yourself
Pick a car as your entity. Name two attributes you would store, give one piece of data for each, and say what cannot change once the record is declared.
Flashcards
(13)What are data structures used for?
What is a record?
What is an entity?
What is an attribute?
In the player record, what is 'rockstar9'?
What is decided when a record is declared?
Why is a record called a static data structure?
How is a record declared in pseudocode?
What does a database hold for a particular entity?
Does Python have a native record type?
In a dictionary used as a record, what does a key identify?
How are items accessed in a list?
How can many records be stored together in Python?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore OCR GCSE Computer Science topics
- Data type: Real
- File handling: open, read, write, close
- Inputs, outputs, assignments
- Iteration (count- and condition-controlled loops)
- Local and global variables
- Operators (arithmetic and Boolean)
- Random number generation
- Sequence
- SQL: SELECT, FROM, WHERE
- Sub programs: functions
- Sub programs: procedures
- Variables
How this lesson was checked. This OCR GCSE Computer Science (specification J277)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 5 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.