Académique Documents
Professionnel Documents
Culture Documents
CS 102
File – a collection of related data
File Structures & examples : student records, payroll file
File Organizations Entity – a data item of interest
example : student or employee
Fields or Columns – data related to an entity or
Chapter 01 object
Introduction to File Organizations examples : last name, first name, gender, birth
date, (degree program or department), (year
level or job title), etc.
CJD
Record or Row – a grouped collection of fields collection of data usually too large to fit in main
about an entity or object memory
examples: fields about a student or employee only a small portion of the file is accessed at a
Key – one or more fields chosen to identify a time need to be in internal memory
record uniquely. Files are usually ordered file needs to be stored permanently in non-
according to key values. volatile storage for access by several programs
examples: student or employee number, or last
name, first name and birth date.
Preference : Contiguous storage of data
provides quicker access to information.
CJD CJD
CJD CJD
1
File Organizations Sequential File Organization
the way in which records are stored in an Records are stored and accessed consecutively
external file. in sequence from beginning to end
the data structures used for organizing the data Records are usually in ascending or descending
order by the key field
CJD CJD
CJD CJD
relative record number x fixed record length Blocks are fixed length.
2
Indexes Indexes
there is a hierarchical structure of record keys index can specify order in which file should be
and relative block numbers called an index accessed sequentially by record keys.
To retrieve a record, access speed is almost as fast as random file
index is used to retrieve the relative record organization but slower due to the index search
number of the block containing the record,
then the relative file of blocks is accessed
randomly
then the block is searched sequentially for the
record
CJD CJD
CJD CJD
CJD CJD
3
File Characteristics File Characteristics
Usage characteristics of a file : volatility – number of records added and
file size – consider initial and future file sizes to deleted compared to original number of records.
determine storage that can accommodate file. high volatility – best updated using merge
activity – percentage of master records updated procedures. Non-sequential files have high
during a maintenance run overhead to reorganize as a result of these
updates.
high activitity is more efficiently stored using
sequential file organization frequency of use – sequential files require more
time to update on hourly basis instead of daily or
low activity is more efficiently stored using monthly basis, so can’t be used frequently
organizations with random access that allows
update in place required response time – real time access
require random access
CJD CJD
4
File Manipulations : Multifile File Manipulations : Multifile
4. Multifile Information Systems 4. Multifile Information Systems : DBMS
uses many master files Database management systems (DBMS) is a
designed to reduce duplication of information multifile information system
CJD CJD
End
CJD