0% found this document useful (0 votes)
17 views5 pages

File Organisation 2023

Uploaded by

josephchake1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views5 pages

File Organisation 2023

Uploaded by

josephchake1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

FILE ORGANISATION

FILE COMPONENTS

A DATABASE is a structured collection of related data. It can be a single file that


contains a large number of records or a collection of files. The components of a
database file are bit, byte, field, records, file / table, database, character, word

TABLE: collection of related data organized in rows and columns

FILE: It is an organised collection of related records. It is also called data file. Eg. A
Transaction file, Master File.

FIELD: It is a single data item. A field contains similar data about all the entities
since a field has a particular data type. Eg. Student surname, student first name,
age, class, address in a student’s file. In a database, a field is signified by a
column.

RECORD: It is a collection of related fields. A row in a database is called a record. A


record contains different data about one entity which belong to different fields.

PRIMARY KEY, KEY FIELD OR KEY: It is a field that differentiates the records in
a file. The data stored in a key field contains data that is unique to a specific record.
A student record would use student_ID as a key field because it uniquely identifies
each student.
Primary key Fields

Regist_no Owner Make Model Colour

B 666 HHH M. Malaakatse Toyota Corolla White


B 123 JKL J. Selomo VW Polo Red
B 789 WQR S. Disiile Kia Sportage Navy blue
B 001 AAB BMW 318i Silver
S.Poso

Records
Data item

FILE ORGANISATION AND THEIR METHODS OF ACCESS

The method of organisation of a file refers to:


 The way in which the records are arranged within the file;
 The method of working out where each record is stored in the file.
The method of access to a file refers to the way in which a program reads data
from a file or writes data to it.

Page | 1
1. SERIAL FILE: Records are stored onto the storage medium one after
another as they are entered.
Serial Access: A method in which to read a record it is necessary to read
through all the preceding records first.

2. SEQUENTIAL FILE: Records are stored onto the storage medium one after
the other but in a defined sequence according to the record keys.
Sequential Access: A method in which the records are read from the first
until you reach the one you want.

3. DIRECT (RANDOM) FILE: Records are stored onto the storage medium in
no particular order.
Direct Access: A method where any record can be accessed without having
to access other files first. It is also known as random access.

File organization File access Storage media


Serial file
Sequential file
Random file

Notes:

 File stored in a tape cartridge are always serial or sequential access. A direct
access would involve too much movement of the tape forward and backward.
Direct access files can only be stored on a direct access medium (such as
magnetic tape).

Reasons for choosing different methods of access


The choice of access depends on:

 The number of records to be accessed.


If not many records are to be accessed, direct access should be used.

 The size of the record.


For large files sequential searches takes a long time and direct access is
better.
For a small file the time delay is not important and a sequential access is
acceptable.

 The type of storage medium being used.


On magnetic tape files have to be serial or sequential – direct access to tape
files is not practical.

 Whether or not the application is interactive.


Serial or Sequential access is often suitable for batch processing.
On-line applications such as information retrieval usually need direct access.

Page | 2
TYPES OF FILES
There are various types of files.
1. Transaction File It is a file that is used to hold temporary data which is used to
update the master file affected by the transaction. It is a collection of transaction
records like sales transactions, payroll transactions.

2. Master File: The most important file since it is the most complete and up-to-
date version of a file. Examples of master files can be inventory master file, general
ledger master file, receivables master file.

3. Security/Backup File is a copy of a file which is kept in case the original gets
lost, stolen, corrupted or damaged. For a large organisation, this may be
detrimental to its operations and existence. However, it is possible to recreate a
master file using the grandfather-father-son principle.

Grandfather, Father, Son principle


A generational backup is one of the simplest, most effective methods for making
and keeping backup copies of your data. Properly done, it combines ease of use and
data protection. The most common generational backup scheme is the three-
generation or "grandfather-father-son" (GFS) method. In its most basic form it
involves making a complete copy of the data to be backed up on removable media
such as tape or CD. This is the grandfather. At the next scheduled backup period,
say the next day, another complete copy of the data is made, which of course
includes the changes in the data during that period. This is the father. At the next
scheduled backup, the third copy, or son is produced.

The fourth backup is made by recording over (or replacing, depending on the
media) the grandfather copy. The new copy becomes the son, the previous son
becomes the new father and the father is promoted to grandfather. This continues
in rotation so there are always three backups, each of a different point in time.

Page | 3
The advantage of saving the two previous backups as well as the current backup is
that if the computer data somehow become corrupted and the problem isn't caught
until after the backup is made, there are still two uncorrupted, albeit increasingly
out of date, backup copies. Given reasonable care, it's unlikely a problem will
corrupt all three backups before it is caught. Similarly, if one of the backup copies
is damaged, you still have two more. The three-generation backup also makes it
easy to store one of the copies (usually the grandfather) in a more secure and often
off-site location.

Refer to Fig 8.5 p.67

SUMMARY OF FILES

Transaction File Master File


used to hold temporary data Used to hold data permanently
used to update the master file Updated by the transaction file
a collection of transaction records most complete and up-to- date
like sales transactions, payroll version of a file like customer records
transactions

Task: Using the above principle, fill data in the figure below

Page | 4
Page | 5

You might also like