2 Feb 2020

  • February 02, 2020
  • Amitraj
Sequential File Organization

This method is the easiest method for file organization. In this method, files are stored sequentially. This method can be implemented in two ways:-


1. Pile File Method -

-> It is a very simple method. In this method, we store the record in a sequence, i.e., one after another. Here, the record will be inserted in the order in which they are inserted into tables.


-> In case of updating or deleting of any record, the record will be searched in the memory blocks. When it is found, then it will be marked for deleting, and the new record is inserted.









Insertion of the new record:-


Suppose we have four records R1, R3 and so on upto R9 and R8 in a sequence. Records are nothing but a row in the table. Suppose we want to insert a new record R2 in the sequence, then it will be placed at the end of the file. 









2. Sorted File Method -

In this method, the new record is always inserted at the file's end, and then it will sort the sequence in ascending or descending order. Sorting of records is based on any primary key or any other key.







Insertion of the new record:-

Let us assume that there is a preexisting sorted sequence of four records R1, R3, and so on upto R6 and R7. Suppose a new record R2 has to be inserted in the sequence, then it will be inserted at the end of the file and then it will sort the sequence.









Pros (Advantages) of sequential file organization

1. Simple design.

2. Fast and efficient method for huge amount of data.

3. Files can be easily stored in magnetic tapes i.e cheaper storage mechanism.

4. This method is used for report generation or statistical calculations.




Cons (Disadvantages) of sequential file organization

1. Sorted file method takes more time and space for sorting the records.

2. Time wastage as we cannot jump on a particular record that is required, but we have to move in a sequential manner which takes our time.




Translate

Popular Posts