File Organisation Flashcards
List the hierarchy of data in a file.
1 Bit = 1 or 0 (binary digit) 1 Byte = 8 bits 1 Field = Many bytes 1 Record = Many fields 1 File = Many records 1 Database = Many files
Describe the organisational format and access speed of 3 types of File organisation.
Serial:
Organisation: No Order
Access Speed: Slow
Sequencial:
Organisation: In order (often by primary key field).
Access Speed: Slightly faster (but still slow).
Direct:
Organisation: Various
Access Speed: A damn lot faster!
Describe how you would find a record in a serial file.
Just look through each record until you find the record required, or you reach the end of the file (and haven’t found it).
Describe how you wound find a record in a sequential file.
Start at beginning, look through each record until:
- you find the record that matches,
- you find a record with a key higher than the one you are looking for.
- you reach the end of the file.
Describe how you would delete a record in a sequential or serial file.
Simply copy all records apart from the one you want to delete from the Old File (Father) to a New File (Son).
State how you add a new record to a serial file.
Just store it at the end of the file, after the last record.
Describe how you would add a new record into a sequential file.
Simply copy all records up to the insertion point, from the Old File (Father) to a New File (Son), write the new record to the new file, then copy the rest of the Old File over.
Explain the process of updating a master file from at unsorted serial file.
I will fill this in!
Describe, giving a reason, a situation where it would be more suitable to use direct (random) access files instead of indexed sequential.
Much faster to find and edit records in a random order, especially in large files. This would be suitable for editing sales records for customers, as they need to be updated in a unpredictable order (as sales come in).
Describe what happens when a hashing algorithm allocates a record to a storage location already occupied, and what happens when you want to access it later.
Store it in next available space or goes to next space in overflow area.
To find it, if the record is not found in the original location, check the following records until next available record, or search linearly through overflow area.