Add:a record to master file
Update change the content of the records or fields in master file
Delete:remove a record from the master file.
Transaction log or change file is a file that keeps track of the changes to the transaction file
SERIAL AND SEQUENTIAL FILE ORGANISATION
In Serial File Organization records are rearranged one after another in the order in which they were added.NB:The records are not sort in any particular order.
Example:Unsorted invoices for customer for one day,a typical shopping list
Serial Files can be stored on tape,dish or memory.Used mainly for backup.
In sequential file records are stored and sorted in order on one or more key field.
Example:Invoices of customers sorted by customer number.Class registers sorted on last name.
SEARCHING FOR A RECORD
In both serial and sequential access-records are found by accessing the files one by one in the order they were stored until the right one is reach.This is infact very difficult if the data is very large however it is very effective when viewing and modifying records in a large batches.
ADDING A RECORD
Serial:Add record to send of the file
Sequential:Records must be inserted into the file in the correct position and not at the end of file like serial access to preserve the ordering of the file.
You cannot insert all changes to records in a sequential files into the existing file
A new file must be created which contains the inserted records
UPDATING S RECORD
All the updates are gathered in transaction file and then applied in the master file.This is done by creating a new file which contains the updated records
To improve the efficiency of the updating process sort the master and transaction file records in the same order.
DELETING A RECORD.
With both types of file the only way to delete is to create a new file which omits the records marked for deletion
RANDOM OR DIRECT FILE ORGANIZATION
This is when the file are sorted in any order.The computer maps out where all this data is stored so you can immediately access it thus making it easier to search.update ,delete and insert records.
The file is organized like a One dimensional table on disk where each records is part of the table.The record number acts like a table index to allow you to find the records
You can access a record directly or randomly by calculating its location using a mathematical formula and going directly to the record.
Direct access files also support sequential access by allowing the records to be read one after another.The records in a direct access file are not stored in ascending or descending order,but are stored in random order.
Two Common ways in which mathematical formulae operate are by direction mapping (relative) and address calculation (hashing)
DIRECT MAPPING:Uses relative addressing in which the primary key value is relative to the start of the file.E.g-a file with space for 1000 records will have relative addressing from 1,2,3 through 999 and 1000
the record areas labelled 'free' have not yet had record values written in them,Disadvantage of direct mapping is wasted space if there are few keys stored in the file.
ADDRESS CALCULATION (HASTING)
More common method of direction access file organization.To retrieve a recede from direct access,you apply the hash function to the record's primary key o obtain an address.A block of records is retrieved and its content are examined to see if the required record is there.
Two common has functions are
Truncate the key
Divide the record key by a prime number and use the remainder
A hash function may not provide a unique address every time,so two or more record keys may be placed in the same logical block called collision.
Two method used to resolve collisions are linear probling and double hashing.
Linear probing involves a sequential search from the hashed location until an unoccupied position is found
Double hashing means using a second hash function to computer a new address
Index sequential file ordering uses an index file to store records.Records are stored in this file in sequential orde and a set of indices are used to refer to each item sotred in the file.Each record can be accessed via its index number.This file ordering is a combination of sequential and random file ordering and is used when records need to be sorted in sequence but individual records must be quickly accessible