44 total
By the end of this subtopic, you should be able to:
A file stores data on secondary storage. The data inside a file is usually stored as records. A record is one complete set of related data about one thing. For example, one student record might contain a candidate number, name, and mark.
When we talk about file organisation, we mean the way those records are arranged inside the file.
This matters because the arrangement affects:
So, file organisation is really about one big question:
How should records be stored so that the file works well for its job?
In this topic, you need to know three file organisation methods:
You also need to know two file access methods:
It is important not to mix these up.
In a serial file, records are stored one after another in the order they are added.
That means the first record entered goes first, the next one goes after it, and so on. New records are usually appended to the end of the file.
So a serial file is based on time of entry, not on sorting by any field.
A serial file:
If hourly temperature readings are stored as they are recorded, the readings naturally arrive in time order. A serial file is a good choice because each new reading can simply be added to the end.
Serial files are useful when:
A good example is a transaction log. Every new transaction can be added to the end as it happens.
The disadvantage is that finding one specific record can be slow. Because records are not arranged by key value, the file often has to be searched from the beginning until the record is found or the end is reached.
So serial files are simple, but not the best choice when very fast searching for one record is needed.
Sign in to view full notes