Organisation And Structure Of Data Flashcards
What does the MOD function do?
the MOD function returns the remainder
e.g. 10 MOD 3 = 1 (3+3=9, remainder 1)
What does the DIV function do?
the DIV function returns the amount of times one number goes into another
e.g. 10 DIV 3 = 3
What is a transaction file and what does it do?
A transaction file is a temporary file.
It collects data over a short period of time (e.g. a month).
At the end of the timescale, the data from the transaction file is copied to the master file, often using batch processing.
What is a master file?
at the end of a transaction files timescale, the data from it is copied over to the master file (batch processing)
Master files will store all of the data required to perform batch processing operations such as generating bills etc.
What happens to both a master and transaction file before performing the update?
The transaction file will be sorted in the same primary key order as the master file
This is to speed up the update as both files only have to be read through once to perform the update
What are fixed length records?
Where all records are exactly the same length
When using fixed-length records, you need to make the record length equal to the length of the longest possible record.
What is an advantage of a variable-length record?
Using variable-length records usually enables you to save disk space.
What is a serial file?
A transaction file
e.g. recording sales in a shop “clocking in”
What are the disadvantages of a serial file?
Very slow to search
This is because as the records are stored one after the other in no order there is no choice there is no other option other than to search one-by-one to find an item. This is a serial search.
What is an advantage of a serial file?
Adding records is very straightforward and fast
What is a sequential file?
A sequential file had records stored one after the other in order of a key field (e.g. employee ID)
can be used with either tape of disk storage
What is a sequential file often used as?
A sequential file is often used as a master file to allow records to be searched via key field.
What are the advantages of a sequential file?
If performing a batch update, it can be quicker to perform the update if the master file and also the file being updated from are in sequential order.
When searching for a record that doesn’t exist, it will be quicker to spot that it isn’t there.
Easier to program than methods such as indexed sequential.
What is the disadvantage of a sequential file?
Can be slow to add records as they need to be added in the correct place
What is the process of adding a record to a serial file?
You open the file
Record is added to the end of the file
You close the file