File organization in DBMS

What is file ?

File is a collection of information or material that is stored at on place.  

structure of file/components of file:-

1.charactes or byte: A bit is a smallest unit of data representation .8 bits=1 byte 1 character=1 byte
2.data items: Data items are used to describe attributes of object or entity.These are stored in the fields.
3.Record: Records are the collection of related fields .Data items related to any object or entity are grouped in record.

Types of records :-

1.Fixed length records :The record which is fixed in behaviour and length is called as fixed length record .In the below example student record is fixed length record.

2.Variable length record :The record which is variable in behaviour and length is called as variable length record .In the below example customer record is changing because data in that table can change as per situation .

 


4.File :This is also a component of file .It is collection of logical related items .  
 

Types of files :- 

a)Logical file :File which is viewed in terms of what data items contains and which operation may be performed is called as logical file

b)Physical file :File which is viewed in terms is how data items are stored in memory is called as physical file


Basic file operations :-

1.Open file operation

2.Close file operation

3.Reading & Writing file operation

4.Seeking file operation

Let's see this points in details ,

1.Open file operation :-In this operation we can open existing file . The program pointer points to the position of first element .

2.Close file operation :-In this operation we can close existing file .Closing a file is most important task for protection of data without loosing it.

3.Reading & Writing file operation :-For reading data from file we have to open that file .In the reading mode we can not edit that data , just can read it.For writing data into file we have to open that file in writing mode . In this mode we can edit data in that file

4.Seeking file operation:-This operation is performed to read byte from one to next element .Every time a byte is read , pointer is head to the next element. 

To perform this operation we use the following formula :

seek(source_file,offset)


Actual operations:-

a)find next : It is used to find next element.

b)delete : It is used to delete any byte.

c)modify : This is used to update the byte or record operations for single record:

a)find all : It is used to find all bytes

b)find ordered : It is used to find the ordered elements

c)recognize: It is used to reorder file records.


What is BLOB:-
- BLOB stands for Binary Large Objects . The small elements or part of unstructured file are called as BLOB.