In: Computer Science
Explain the process of creating flat (text) files and how to store/retrieve data.
Flat (text) files
A flat file, also known as text database, is a type of database that stores data in plain text format. Flat file databases were developed and implemented in early 1970s by IBM.
Flat files typically text files that have all word processing and structure markup removed. A flat file features a table with a single record per line. The different columns in record use a tab or comma to delimit the fields. The flat file database does not have multiple tables, unlike in relational database. The information contained in flat files does not have associated paths or folders.
Store/retrieve data
Each column in flat file database is restricted to a specific data type. The delimiters are used to keep the data formatting at fixed width, and to make it easier to find different fields within a record.
The first row in flat file refers to the field name – which makes it easier to determine what data is dealt with in each field. All rows in the flat file database follow tuple concept in relational algebra, where tuples are an ordered list of elements.
Data in flat files remains in its original form until it is transferred into a staging area in a warehouse or a database management system. After transmission is complete, the data is altered and saved in different forms.