Each piece of information in a computer is stored as file in its hard disk. There are basically two ways of storing information in a hard disk. One, as a text file, which contains only textual data; and another, as a binary file, which contains non-textual data, like pictures, audio, video etc.,
Databases themselves are stored as files in the hard disk. The primary difference between a database and a file is the way information is organised in a database. Typically, information in files would be organised in a way as to reproduce it in a sequential format. Further, information in a file would be something that makes sense as a whole bunch, not in parts. For eg., audio/video files would have information in such a way that when the files are opened using a audio/video software, the information is reproduced sequentially.
In contrary, information in databases is organised in such a way that parts of information could be accessed easily. Further, parts of different information could be accessed and produced in different combination to give different view of the data.
Databases themselves are stored as files in the hard disk. The primary difference between a database and a file is the way information is organised in a database. Typically, information in files would be organised in a way as to reproduce it in a sequential format. Further, information in a file would be something that makes sense as a whole bunch, not in parts. For eg., audio/video files would have information in such a way that when the files are opened using a audio/video software, the information is reproduced sequentially.
In contrary, information in databases is organised in such a way that parts of information could be accessed easily. Further, parts of different information could be accessed and produced in different combination to give different view of the data.

For eg., one view of the Address book would be a list of contacts in a particular city. Another view would be a list of contacts with the first names starting with the letter 'A'. In addition, if the database contains the details of amount lent/borrowed to/from each contact in a Transaction table as shown above, then one might create a view of outstanding amount for each contact in a particular city. In this case, this view is a combination of data from both the Address book with a filter specifying the city and the details of amount lent/borrowed in the Transaction table.
Miscellanea:
Different DBMS use different methods of structuring data. The table structure discussed above is the method used commonly by Relational Database Management Systems (RDBMS).
A simple way to identify if a file is a text file or a binary file is to open in notepad. A text file (like a .txt file) will be human readable, while a binary file will not make any sense to the reader.
A database is usually stored as a binary file. Possible reasons would be
1. Databases may store binary data like images.
2. To store information in an optimized way so that data can be read/written in an optimized way.
Miscellanea:
Different DBMS use different methods of structuring data. The table structure discussed above is the method used commonly by Relational Database Management Systems (RDBMS).
A simple way to identify if a file is a text file or a binary file is to open in notepad. A text file (like a .txt file) will be human readable, while a binary file will not make any sense to the reader.
A database is usually stored as a binary file. Possible reasons would be
1. Databases may store binary data like images.
2. To store information in an optimized way so that data can be read/written in an optimized way.
No comments:
Post a Comment