Data Files

   

Data Organization

  1. Data is typically organized into groups when stored in secondary storage:
    1. Character -  A single letter, number, or special character
    2. Field -  A set of related characters
    3. Record -  A collection of related fields
    4. File -  A collection of related records
    5. Database -  A collection of related files
        
  2. A particular field called a key field must be chosen to uniquely identify each record in a database.
    1. Duplicate numbers in key fields of records are not permitted.
    2. Some common key field examples are:
      1. Social Security Number
      2. Employee Identification Number
      3. Part Number of a Product
          

   

Processing Modes

Data is traditionally processed in two ways.

  1. Batch Processing
    1. Data is collected over a period of time.
    2. 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.
          
  2. Real-time Processing
    1. 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:

  1. Master File
    1. File containing all records current up to the last update.
    2. An example of a master file is a customer name and address file.
        
  2. Transaction File
    1. File containing recent data that will be used to update the master file.
    2. An example of a transaction file is current customer purchases and/or payments.
        

   

File Organization

Files containing data may be organized in different ways:

  1. Sequential File Organization
     
    1. Records physically stored one after another in the order of entry.
    2. Very efficient if a large portion of the records needs to be accessed at the same time.
    3. Searching for a record must always be done starting from the beginning of the file.
    4. Can store records on tape or disk.
         
  2. Direct File Organization
    1. Records are physically stored in areas on a disk at particular locations.
    2. Locations are determined by hashing (method of calculating an address from the key field).
    3. Special software is used to convert key fields to numeric values for storage or access.
    4. Can only store records on disk using this method.
    5. Fast, direct access to records.
    6. Not as good as sequential organization for frequent updates or for listing many records.
         
  3. Index File Organization
    1. Advantages of both sequential and direct file organizations.
    2. Records are stored in sequential order in groups, along with an index.
    3. Index includes the key fields and disk addresses for the records.
    4. Can only store records on disk using this method.
    5. Especially useful when files are frequently accessed both sequentially and directly.

il

 

  

<  Previous Page                                         Next Page >