Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,"— Presentation transcript:

1 Organization of Information

2 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

3 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 ?

4 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.

5 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)

6 Information hierarchy database file record field ….

7 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

8 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

9 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

10 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

11 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

12 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

13 Sequential file.. AU WC,67CHAN TM,67 MA SL,67 LAU SY,67 Beginning of file Record data Record #2 Key field End of file Rec #1 Rec #3

14 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

15 Direct file Rec Key  address Track#15, sector#8 ‘LAU SY’  transformation  track#15, sector 8

16 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


Download ppt "Organization of Information. Files, records and fields Paper files  computer files E.g. customer accounts information stored in a bank Customer name,"

Similar presentations


Ads by Google