Data Structures 2
Data Structures 2
A record is a group of related data held Data can be written to a file via the computer There are two main types of records; fixed length and
within the same structure. A record is user interface. variable length records.
a grouping of fields within a table that
reference one particular object.
Fixed length records
An example of the structure of a pupil record
is:
Each record in a file will be the same length with the
size of each field remaining consistent.
Data
Fieldname Length Example
type The Pupil records will all have pupilIDs that are 5
PupilID String 5 P0001 characters in length with the same format P9999.
The firstname field has been set at 20 characters. If a
Firstname String 20 Fred
pupil’s name is shorter that 20 characters a series of
Surname String 20 Smith blanks (padding) will be stored in that field, e.g. if Fred
is stored in a record, there will be four characters and
House No Integer 10 16 blanks.
Postcode String 8 CF62 6YX