1.6 Organisation and Structure of Data Flashcards
What is the purpose of a file in data processing?
To store data which can be used by programs that process the data.
What is a file?
An organized collection of related records.
What is a record?
A collection of related fields.
What is a field?
A single data item.
Give 3 facts on a fixed length field (1).
- The number of characters to be stored is set in advance.
- Data entered can be shorter but not longer than field length.
- Same number of bytes in each record.
Give 3 facts on a fixed length field (2).
- Quicker to process as start/end locations are known.
- Wastes space as fields have blank space.
- Fixed length records will truncate long fields.
Give 2 examples on the use of a fixed length field.
- Postcode
- National insurance numbers
Give 4 facts on a variable length field.
- There is no maximum or a very high maximum field length.
. - Different number of bytes in each record.
- Saves storage space as no blank space.
- Avoids truncation as each field can extend to the number of characters needed.
Give 2 examples on the use of a variable length field.
- Address
- Personal statement
(Data that can be of any length).
State 2 advantages for a fixed length field.
- Access is fast as computer knows where each record starts.
- Easier to program as it is easier to calculate how much space is required.
State 2 disadvantages for a fixed length field.
- Records are usually larger and need more storage space.
- Slower to transfer (load or save) or transmit down a network.
State 3 advantages for a variable length field.
- The records will be smaller and will need less storage space.
- The records will load or save faster.
- The file will be faster to transfer or transmit down a network.
State 2 disadvantages for a variable length field.
- The computer will be unable to determine where each record starts so processing the records will be slower.
- Harder to calculate how much
storage space is needed.
What is a transaction file? (2)
- It contains updates to be applied to a master file. eg. Recent purchases.
- It is a temporary file.
What is a master file? (2)
- The main file. eg. Bank balance.
- Semi-permanent, Most data is never changed but some of the fields may need to be updated occasionally.
What are the 4 access methods of a file?
- Sequential
- Indexed sequential
- Direct (aka random)
- Serial
What are sequential files?
Stored in order of a record key (numerical order) eg. Class register.
How is a new record added to a sequential file? (4)
- New copy of the file is made.
- Records before the new record are copied from old file to new.
- New record is added to new file.
- The rest of the records from the old file to the new.
How is a record deleted from a sequential file? (3)
- A new copy of the file is made.
- A file is copied to a new file one record
at a time. - The record to be deleted is not copied across.
State 2 advantages for sequential files.
- Easier to program as fewer overheads.
- Fast access to record.
What are indexed sequential files? (3)
- The record key and pointers are stored together in order of record key.
- The bulk of the record is stored anywhere on the disk.
- The pointer shows where the rest of the file is located.
What are the 2 parts a record in an indexed sequential file is split into?
- A record key and pointer
- The bulk of the record