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 fixed-length record?
They are faster to process since the exact position of the record is known.
This is because all records are the same length, therefore you are able to jump to the desired record.
What are Variable-Length records?
Where the length of each record varies according to the data it holds.
What is an advantage of variable-length records?
Using variable-length records usually enables you to save disk space.
What is a serial file?
A serial file is where records are stored one after the other, in no particular order (records are added to the end of a file)
Can be used with either tape or disk storage
What is the main use of a serial file?
A transaction file
e.g. recording sales in a shop “clocking in”
What is an advantage of a serial file?
Adding records is very straightforward and fast
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 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.