Topic 6 · Notes

Organisation and structure of data

These notes are part of a subscription

11 sections covering the whole specification for this topic, with worked examples.

Preview

Fields, records and files

TermMeaningExample
FieldOne item of dataSurname
RecordAll the fields about one person or thingOne student's details
FileA collection of related recordsEvery student in the school
Key fieldA field that identifies each record uniquelyStudentID

Designing a file means deciding, for each field:

  • its name, which should describe the data
  • its data type: text (string), integer, real, date, Boolean
  • its length (for text fields) or size in bytes
  • any validation rules
  • which field is the key and the order the records are kept in

Choose data types carefully. A phone number is stored as text, not an integer: it has a leading 0, may contain spaces, and is never used in calculations. Dates are stored as a date type so they can be sorted and compared properly.

Also in these notes

  • Fixed and variable length recordsAS
  • Master and transaction filesAS
  • File organisation and accessAS
  • Backup, generations and archivingAS
  • ValidationAS
  • VerificationAS
  • Creating and processing filesA2
  • Hashing algorithmsA2
  • Multi-level indexesA2
  • Overflow and file reorganisationA2