Download - Chapter 5 - Types of Data
-
File Organization
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Records
A record is an organised collection of information about an object or item
Ted Postlethwaite10 West Hill
Highgate
London
N6 3PY
Fixed or variable length records: pros and cons?
Ted Postlethwaite 10 West Hill Highgate London N6 3PY
Ted Postlethwaite 10 West Hill Highgate London N6 3PY
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Pros and Cons: Fixed and
Variable Length Records
Fixed-Length Records Easy to implement
Can predict where records will start and end so faster access
Wastes space
Can be inflexible as space allocated may become too small
Variable-Length Records Uses disk space economically
Flexible
Difficult to implement
Slower access
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Data types
Boolean True/False
Integer Whole numbers, e.g. 1, 2, 999
Real Fractional numbers, e.g. 123.456
DateTime Any date- or time-based value, e.g. 29/11/2005,
13:08, 0.001 seconds
String (text) Names, addresses, emails, etc.
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
File Organization
Describes how records are stored within a file
Three organization methods Serial
Sequential
Random
All other organization schemes are variations of or combinations of these methods
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Serial Access
Harris
Shah
Oworu
Tooey
Wickham
Hussein
Heim
Hansen
Schmidt
Arnold
OHanlon
Zachary
Christopher
Records not in order.
Search starts at the beginning of
the file.
Records read in the order that they
are stored.
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Records are stored in chronological order (in order as they are input or
occur)
Examples
Recording of telephone chargesATM transactionsTelephone queues
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Sequential Access Suitable for applications that require sequential
processing of the entire file
The records in the file are ordered by a search-key Search starts at the beginning of the file
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Sequential Organization
Records are stored in order based on a key field
Key field A field containing a value that uniquely identifies a record
ExamplesNamesAccount numbersStudent numbers
Example Phone directories
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Every record on the file is processed starting with the first record until EOF is reached
Suppose we only want to access the 4th
record
The 3 records that precede it must be accessed first
Inefficient when records must be processed in a sequence other than their physical order
on the device
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Sequential Access Is Efficient
When
A large number of the records on the file must be accessed at any given time
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Direct (Random) Access
A high percentage of todays information processing must be done non-sequentially
Records are located by knowing their physical locations or addresses on the
device rather than their positions relative
to other records
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Compare Looking for a Recording on
a CD versus on a Cassette Tape
DIRECT
SEQUENTIAL
Data stored on a CD device (direct-access) can be accessed either
sequentially or nonsequentially
Data stored on a tape (sequential access) can be accessed only
sequentially
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Types of Files Used by Business
Systems
Temporary
Files
Mirror
FilesArchive
Files
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Master Files
Contain the current information for a system
customer file
student file
telephone directory
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Table Files
Type of master file Change
infrequently
Stored in a tabular format
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Transaction Files
Contain the day-to-day information generated from
business activities
Used to update or process the master file
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Temporary Files
Created and used whenever needed by a system
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Archive Files
Backup files that contain historical versions of other files
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Types of Database
Flat-file database One file
One record per line
Essentially a long list
Relational database Data held in separate tables
Each table relates to an entity in the data model
Tables linked by foreign key relationships
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Pros and Cons: Flat-file Databases
Can be very fastSimple to design and implement Inflexible only useful for the
application it was designed for
Data redundancy (same data repeated throughout the database)
-
A presentation by M. Naveed Rajput (ICT Teacher PISJ-ES Jeddah)
Pros and Cons: Relational
Databases
Extremely flexible, can model almost any system
No data redundancyComplex softwareRequires skilled administration