module 1 class 3 file ion

Upload: tomy-mathew

Post on 05-Apr-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Module 1 Class 3 File ion

    1/20

    FILE ORGANIZATION

  • 7/31/2019 Module 1 Class 3 File ion

    2/20

    File Structure

    In DBMs Data are stored in files

    A Database may contain several files Each file contains a number of records

    Each record contain various attributes

    Each attribute is called a field

  • 7/31/2019 Module 1 Class 3 File ion

    3/20

    Database Definitions

    Entity: Object, Concept or event (subject)

    Attribute: a Characteristic of an entity Row or Record: the specific characteristics of

    one entity

    Table: a collection of records

    Database: a collection of tables

  • 7/31/2019 Module 1 Class 3 File ion

    4/20

    File Organisation

    The technique used to represent and store

    the records on a file is called the fileorganisation

  • 7/31/2019 Module 1 Class 3 File ion

    5/20

    TYPES OF FILE ORGANIZATION

    Serial Sequential

    Indexed Sequential

    Direct Access /Random Access

  • 7/31/2019 Module 1 Class 3 File ion

    6/20

    Serial File Organization

    A collection of records

    No particular sequence Cannot be used as master

    Used as temporary transaction file

    Records stored in the order received

  • 7/31/2019 Module 1 Class 3 File ion

    7/20

    Sequential File Organization

    A collection of records

    Stored in key sequence Adding/deleting record requires making new

    file

    Used as master files

  • 7/31/2019 Module 1 Class 3 File ion

    8/20

    Sequential file

  • 7/31/2019 Module 1 Class 3 File ion

    9/20

    Advantages

    Simple file design

    Very efficient when most of the records mustbe processed e.g. Payroll

    Very efficient if the data has a natural order

    Can be stored on inexpensive devices likemagnetic tape.

  • 7/31/2019 Module 1 Class 3 File ion

    10/20

    Disadvantages

    Entire file must be processed even if a single

    record is to be searched. Transactions have to be sorted before

    processing

    Overall processing is slow

  • 7/31/2019 Module 1 Class 3 File ion

    11/20

    Direct (Random) File Organization

    Records are read directly from or written on

    to the file. The records are stored at known address.

    Address is calculated by applying amathematical function to the key field.

  • 7/31/2019 Module 1 Class 3 File ion

    12/20

    Direct (Random) File Organization

    A random file would have to be stored on a

    direct access backing storage medium e.g.magnetic disc, CD, DVD

    Example : Any information retrieval system.

    Eg Train timetable system.

  • 7/31/2019 Module 1 Class 3 File ion

    13/20

    Advantages

    Any record can be directly accessed.

    Speed of record processing is very fast. Up-to-date file because of online updating.

    Concurrent processing is possible.

  • 7/31/2019 Module 1 Class 3 File ion

    14/20

    Disadvantages

    More complex than sequential

    Does not fully use memory locations More security and backup problems

  • 7/31/2019 Module 1 Class 3 File ion

    15/20

    Indexed sequential file

    Each record of a file has a key field whichuniquely identifies that record.

    An index consists of keys and addresses.

    An indexed sequential file is a sequentialfile (i.e. sorted into order of a key field) which

    has an index. A full index to a file is one in which there is

    an entry for every record.

  • 7/31/2019 Module 1 Class 3 File ion

    16/20

    Indexed sequential file

  • 7/31/2019 Module 1 Class 3 File ion

    17/20

    Indexed sequential file

    Indexed sequential files are important for

    applications where data needs to beaccessed.....

    sequentially

    randomly using the index.

  • 7/31/2019 Module 1 Class 3 File ion

    18/20

    Indexed sequential file

    An indexed sequential file can only be stored

    on a random access devicee.g. magnetic disc, CD.

  • 7/31/2019 Module 1 Class 3 File ion

    19/20

    Advantages

    Provides flexibility for users who need both

    type of accesses with the same file Faster than sequential

  • 7/31/2019 Module 1 Class 3 File ion

    20/20

    Disadvantages

    Extra storage space for the index is required