You are on page 1of 17

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH

Name : B. ARUNIMA
Designation : Lecturer
Branch : CCP
Institute : GPW(M), LB Nagar
Topic : Information Management
Semester : V
Subject : RDBMS
Sub. Code : CCP-505
Sub-Topic : Sequential File Organisation
Duration : 50 mins
Teaching Aids : PPTs

CCP505.10 1
Recap

 File Organisation
 Meaning
 Need

■Types of files
 Sequential file
 Flat file
 Random file

CCP505.10 2
Objectives

On completion of this period, you would be


able to know
 Meaning of Sequential file organisation
 Benefits of Sequential file
 Drawbacks of Sequential file

CCP505.10 3
Can you define a file organisation?

 The method of organizing records in a file is


called file organisation

CCP505.10 4
Sequential File Organisation
 Records are stored in sequential order
 The records are chained together by pointers
 The pointer in each record points to the next record

CCP505.10 5
Sequential File Organisation
 A Sequential file is designed for efficient processing
of records in sorted order based on a search key

 The pointer in each record points to the next record


in search key order

 To access 50th record in sequential file, the pointer


moves from 1st record to the 49th record sequentially

 Can be stored on magnetic tapes or disks


CCP505.10 6
Example
The records are stored in search key order using
branch name as the search key (ascending order of
branch name)
Account. No Address Amount
AA101 CALICUT 750
AA105 CHENNAI 500
AA302 DEHRADUN 600
AA106 DELHI 700
AA108 FARIDABAD 400
AA108 GWALIOR 900
AA207 HYDERABAD 700
AA206 IMPHAL 350
CCP505.10 7

Fig 1
Insertion of records in a
Sequential File
 Locate the record in the file before which the
new record is to be inserted in search order
 If there is a free block (i.e., space left after
deletion), then new record is inserted there. Else
 Insert the new record in an overflow block.
 In either case, adjust the pointer so as to chain
the records together in search key order

CCP505.10 8
Example
The following figure shows the file after insertion of the record
AA339 Ernakulam 1000

Account. No Address Amount


AA101 CALICUT 750
AA105 CHENNAI 500
AA302 DEHRADUN 600
AA106 DELHI 700
AA108 FARIDABAD 400
AA108 GWALIOR 900
AA207 HYDERABAD 700
AA206 IMPHAL 350
AA339 Ernakulam 1000
CCP505.10 9
Fig 2
Sequential file advantages

 Easy to understand
 Do not waste disk space
 Ordering of records can be easily
maintained.

CCP505.10 10
Drawbacks of Sequential File
Organisation

 It is not suitable when large number of records


need to be stored
 It is difficult to reorganize the file in sequential order
when records are deleted or inserted
 Individual random modification of records is
impossible

CCP505.10 11
Drawbacks Of Sequential File
Organisation (contd..)
 Reorganizations are costly, and must be done
during times when system load is low
 Insertion or deletion of records leads to creation of
new file
 The frequency with which reorganizations are
needed depends on the frequency of insertion of
new records

CCP505.10 12
Summary
 In Sequential File organisation, the records are
stored in sequential order, according to the value
of “search key” of each record.
 A sequential file is designed for efficient
processing of records in sorted order based on
search key
 To permit fast retrieval of records in search key
order, the records are chained together by
pointers.

CCP505.10 13
Quiz

1. The Sequential file organisation allows


records to be read in sorted order because

a) It is useful for Query purposes


b) It is useful for display Purposes
c) Both of the above
d) None of the above

CCP505.10 14
Quiz
1. Sequential file organisation is suitable in the
case of

a) Large no. of records with many insertions


b) Few no. of records with rare insertions
c) Nil records with no insertions and deletions
d) All of then above
e) None of the above

CCP505.10 15
Frequently asked questions

1. Define sequential file organisation.


2. Explain the benefits and drawbacks of
Sequential File Organisation.
3. Explain the processing of records in
Sequential File Organisation.

CCP505.10 16
Assignment

1. An example or two may be presented to


understand the insertion of data in sequential file
organisation.

CCP505.10 17

You might also like