0% found this document useful (0 votes)
31 views1 page

Organisation of Data

Uploaded by

jude
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)
31 views1 page

Organisation of Data

Uploaded by

jude
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/ 1

AS Computer Science

Organisation of data (1)

Key terms Files, Records and Fields File Access

Term Definition A file is a collection of related records. Serial file access


Records are basic data structures in which
File A collection of data items stored in data is organised as a collection of fields, a
Where data items are read from the physical
the computer and handled as a single field will hold a single data item.
start of the file in the order in which they
unit.
• The number of fields in a record is typically were stored. Serial file access does not
fixed. require data sorting.
Master file A collection of records about a main
• Each field will have a name.
subject of an information system, such
as customers, employees or products. • Each field may have a different data type.
Sequential file access
Master files contain descriptive
data, such as name and address and
summary information, such as amount Fixed length records Where data items are sorted by, and read, in
due and year-to-date sales. key field order.
Records where the size of each field is pre- Sequential
Transaction file A collection of transaction records determined and remains constant.
used to update the summary
information held in a master file. Used where variation in length of fields is 1 2 3 4 5 6 7 8
limited.
Archive file Files stored for record purposes. DIM F_Name AS STRING * 20 (F_Name with
Often comprising multiple data
files combined into a single file for
fixed length). Random or Direct file access
easier portability and storage and Advantage: access is fast/simple, as the
compressed to use less storage space. location of the start of each record is known. Use of hashing: the process of calculating a
But the records are usually larger than numerical value from data items. The values
Index file A file that contains key field data required and therefore need more storage are stored in a hashing table. The values in a
that can be searched quickly, with space/are slower to transfer. hashing table correspond to a file location,
attached addresses that allow access enabling it to be accessed directly without
to a large data file. M r need for any sequential search.
D a m o n
Random
Data processing The collection and manipulation of B o l d
items of data to produce meaningful
3 1 P a r k L a n e
information.

1 3 7 2 8 6 4 5
FILE DESIGN Variable length records

RECORD STRUCTURE for FILE Contacts.txt Records containing one or more fields that Indexed sequential file access
Field can be of differing lengths in each record, to
Data Type Length Description suit the size of data to be stored.
Name Indexes to file data allow direct access to
Contact ID Integer Auto number Unique ID number Often used for text fields that can be large, or grouped data, e.g. location of first record,
for fields that vary greatly in length. with an ID in range > 040 AND < 050.
Contact first name The grouped data would then be read
Initial Character 1 DIM Description AS STRING (No limit to
initial sequentially. Both the index and the file must
length of Description).
Last name String 25 Contact last name be sorted by key field.
Advantage: the records will be smaller and
Contact e mail will need less storage space/will load more
Main Index Index 040 Index 047
E mail String 50 Key Index Key Index Key Index Actual
address quickly. But a calculation will be required location location location Data

Contact telephone to determine where each record starts so


Telephone String 12 processing the records will be slower/more
number
complex.
DoB Date 10 --/--/----

You might also like