Storage and data organisation - EduqasRecords

Arrays form the basis for how data is stored within a program. They must be declared with meaningful identifier names and appropriate data types that match the data. Without the correct data structures and data types, programs will not work.

Part ofComputer ScienceUnderstanding Computer Science

Records

are that can hold data of different . The example below uses the data type ‘date’ for 'DateOfBirth' and the data type for 'Salary'.

Employees

StaffNumberFirstNameSurnamePostcodeDateOfBirthSalary
B22IvanWeberGU12 7FD23-Mar-196834,500
B45SueThompkinsKS3 8GB15-Aug-195228,250
D230AkanshaSharRH3 6SA02-Jan-199522,360
C12KeithWilsonCH4 4DC14-Nov-199918,500
StaffNumberB22
FirstNameIvan
SurnameWeber
PostcodeGU12 7FD
DateOfBirth23-Mar-1968
Salary34,500
StaffNumberB45
FirstNameSue
SurnameThompkins
PostcodeKS3 8GB
DateOfBirth15-Aug-1952
Salary28,250
StaffNumberD230
FirstNameAkansha
SurnameShar
PostcodeRH3 6SA
DateOfBirth02-Jan-1995
Salary22,360
StaffNumberC12
FirstNameKeith
SurnameWilson
PostcodeCH4 4DC
DateOfBirth14-Nov-1999
Salary18,500

A record data structure uses Field Names as the headers of each column. Each row is the data values for each record, in this example a single employee.

A record must have a , which is a unique for that record. In this example it is StaffNumber.