organization of information. files, records and fields paper files computer files e.g. customer...

16
Organization of Information

Upload: frederick-pearson

Post on 17-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Organization of Information

Page 2: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Files, records and fields Paper files computer files E.g. customer accounts

information stored in a bank Customer name, Hkid, account#,

balance, address, tel# etc. Will be retrieved or updated through

transactions by teller/ATM/phone/internet

Page 3: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Files, records and fields There are thousands of customers There are many pieces of

information for each customer There are other files (personnel,

fixed deposit, foreign currency account etc.)

There is only one copy of each file Why ?

Page 4: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Files, records and fields A file is a collection of related records A record is a collection of related

fields (fields pertaining to a particular record)

A field is a single piece of information which may be of different types (numeric, character, date etc.) and of different length.

Page 5: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Database A database is a collection of related files

for a specific purpose or business E.g. school management

Student personal file Examination file Remission fee file Student activity file Staff file(all the files are related)

Page 6: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Information hierarchy

database

file file file

record record record

field field field

….

….

….

….

….

Page 7: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Master file and transaction file Master file contain data that are needed

for relatively long period of time E.g. customer file are needed for

retrieving or updating the balance Student file are needed for retrieving

the address for sending letters Seat file are needed for retrieving and

updating the seat assignment when booking the seats through the ORBTIX system

Page 8: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Master file and transaction file Transaction file contain data that

are needed for a relatively short period of time

E.g. order file is needed to update the stock file

Attendance file is needed to update the payroll file

Page 9: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Data Processing Periodically, transaction files are used

to update the corresponding master files.

E.g. stock file (items stored in stock)

Item code, description, price, quantity Transaction file (items sold)

Item code, quantity quantity in stock file is updated according

to transaction records at end of day

Page 10: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Practical Using MS Visual Foxpro / Access

Create tables(data files) Design record structure and Input data write programs/forms

Using Pascal Design data structures Create text files Write procedures

Page 11: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Records Records consists of fields Fields are of different types/formats Fields have different length/size Length of record

Fixed length – all records are of the same length and layout

Easier to design records and programs Wasteful of storage

Variable length – different layout and length of records Makes best use of storage

Page 12: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

File organization

Sequential file organization Records arranged in order of some key field For each transaction record, the master file is read

from beginning to end to search for the desired record this is called sequential access mode and files designed in this way called sequential files

Master file and transaction files must be sorted in order of the same key field before processing

May be stored on magnetic tapes or disks

Page 13: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Sequential file

. . . .AU WC,67 CHAN TM,67

MA SL,67 LAU SY,67

Beginning of file

Record data

Record #2

Key fieldEnd of file

Rec #1 Rec #3

Page 14: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Direct/Random file Records are stored in a locations (on disk)

determined by the key field through a hashing technique (math. formula)

Given a record, get the key value, compute the address (which surface,track,sector)

Directly go to the location, then retrieve (or store) the record

Hence direct access mode and direct file time to access is independent of the key value or

location

Page 15: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

Direct fileRec

Rec

RecRec

Key address

Track#15, sector#8

‘LAU SY’ transformation track#15, sector 8

Page 16: Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,

File Processing Sorting – re-arrange the records in a file so that

they are in order of some key field Searching – locate a desired record with a particular

key value Retrieving – reading the data record from the file Amending – changing the content of a desired

record Deleting – remove a desired record from the file Inserting – adding a new record to the file Updating – changing data in file including

amending, deleting, updating