Data Files
Data Organization
- Data is typically organized into groups when stored in secondary
storage:
- Character - A single letter, number, or special character
- Field - A set of related characters
- Record - A collection of related fields
- File - A collection of related records
- Database - A collection of related files
- A particular field called a key field must be chosen
to uniquely identify each record in a database.
- Duplicate numbers in key fields of records are not permitted.
- Some common key field examples are:
- Social Security Number
- Employee Identification Number
- Part Number of a Product
Processing Modes
Data is traditionally processed in two ways.
- Batch Processing
- Data is collected over a period of time.
- Is held in secondary storage for a specific time period until the
time is reached to process it.
- Credit card transactions can be an example of batch processing.
- When items are purchased, the transactions are held until the
billing date and then processed in order to produce bills for customers.
- Real-time Processing
- Data is processed immediately as it is received.
- Automatic teller machines are an example of real-time processing.
- As soon as you withdraw cash from a bank account using an ATM
card, the computer system processes the data and automatically computes
the balance remaining in your account.
File Processing
Two types of files are commonly used to update data:
- Master File
- File containing all records current up to the last update.
- An example of a master file is a customer name and address file.
- Transaction File
- File containing recent data that will be used to update the master
file.
- An example of a transaction file is current customer purchases
and/or payments.
File Organization
Files containing data may be organized in different ways:
- Sequential File Organization
- Records physically stored one after another in the order of entry.
- Very efficient if a large portion of the records needs to be
accessed at the same time.
- Searching for a record must always be done starting from the
beginning of the file.
- Can store records on tape or disk.
- Direct File Organization
- Records are physically stored in areas on a disk at particular
locations.
- Locations are determined by hashing (method of calculating
an address from the key field).
- Special software is used to convert key fields to numeric values
for storage or access.
- Can only store records on disk using this method.
- Fast, direct access to records.
- Not as good as sequential organization for frequent updates or for
listing many records.
- Index File Organization
- Advantages of both sequential and direct file organizations.
- Records are stored in sequential order in groups, along with an
index.
- Index includes the key fields and disk addresses for the records.
- Can only store records on disk using this method.
- Especially useful when files are frequently accessed both
sequentially and directly.
il
< Previous Page
Next Page >