Google
 
Site navigation: [ Home | Theory | Java | Moodle courses | Resource wiki | About ]

Introduction to files at HL

7.1
Files - basics for HL

 

All of the data about Jerry James is a record .

Tutor is a field.

Boarder is a boolean type .

File terminology

A file may be defined as "an organised collection of related records ". A record contains organised data about a single object and the data is contained in fields each of which is of a defined type .

ID

First

Last

Sex

Boarder

Tutor

JERJAM1

Jerry

James

M

False

Ebo

JANJOH1

Jane

Johns

F

False

Fre

JERJAM2

Jersey

Jamper

M

True

Ebo

Quite often, each record is given a unique identifier; in the above example two students could have the same name, the key field (ID) would distinguish their records.

If this wasn't done a mix up could occur and, for example, the wrong parents could get the wrong reports.

One or more fields could be used to keep records in a certain order (eg alphabetical) in which case the file is said to be ordered.

Recall, access methods
The two main ways of storing data on backing store are sequential-access and direct-access.

For example, a payroll program has to access the data file containing all the data on all of a company's employees, it accesses this data one record at a time, one after the other, this is sequential access.

Direct access (sometimes called random access) would be used, for example, in a supermarket where details of all of the items for sale are held in a file, the computer needs to locate an item quickly by moving directly to its record.

Direct access requires some kind of index to be held on the medium (the material storing the data).

Thus records can be ordered or unordered and accessed sequentially (one at a time), the required record will be identified by the key field.

related: [ Topic 7 home | next: partially-indexed files ]

 


 
The site is partly financed by advertising revenue, partly by online teaching activities and partly by donations. If you or your organisation feel these resouces have been useful to you, please consider a donation, $9.95 is suggested. Please report any issues with the site, such as broken links, via the feedback page, thanks.

Questions or problems related to this web site should be addressed to Richard Jones who asserts his right to be identified as the author and owner of these materials - unless otherwise indicated. Please feel free to use the material presented here and to create links to it for non-commercial purposes; an acknowledgement of the source is required by the Creative Commons licence. Use of materials from this site is conditional upon your having read the additional terms of use on the about page and the Creative Commons Licence. View privacy policy.

Creative Commons License


This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. © 2001 - 2009 Richard Jones, PO BOX 246, Cambridge, New Zealand;
This page was last modified: May 31, 2009