YEAR 1 CO1 WEEK 20 FILE ACCESS METHODS Flashcards
What to consider when creating a file?
The way we will retrieve information (specific record) for a file.
Describe Serial Access File
Record in serial file not stored in any particular order except chronologically.
New records appended to the end of the file.
Whole file has to be searched to find a particular record.
How to delete records from serial access file.
New file is created.
All records up to the record to be deleted and then all records after this.
Previous file is then deleted.
When do you usually use a serial access file?
When order of data doesn’t matter.
There is a small number of records.
Data that must be stored in the order it is received.
Describe a Sequential access file.
Records stored one after another in order of the field key (primary key).
Still need to search whole file to find specific record but faster and more efficient than serial.
How to add or remove records for a sequential file.
All records are in order of the field key so cannot just add a new record to the end of the file.
File copied up to the position of the new record then the record is inserted. Rest of file is then appended.
Deleting record same as serial.
Describe indexed sequential file organisation.
Records sorted according to a primary key but seperare index is also kept.
Index is a additional file contains information about where records are stored and allows them to be accessed directly