In database management, a flat file is one that holds all the information in a single table.
By contrast, a relational database has two or more tables having a defined relationship to each other.
A flat file is not related to any other table.
Examples
Flat file
You could keep details of a DVD collection in a flat file. Some of the fields might be:
title
date purchased
length
year issued
Relational database
A retail business might have a database with three tables:
products [one record for each type of item for sale]
customers
products&customers [each sale constitutes a record in this table. The table is related (linked) to each of the other two tables]
Tables and files
"Table" is a database term, "file" a computer term. Some database management programs make each table into a separate file. Others store all the tables in a single file.
Chat with our AI personalities
A hand file where both surfaces are flat. Used to file down metal where the surface requires a flat finish. Other files in the work shop are curved concave, curved convex ,triangular and square. Each used to specific shape filing.
In a flat file, the most common separation between columns will be either a comma or a tab. You could theoretically use anything you wanted, so long as you read it in knowing this. Rows in a flat file are separated with newline characters. (In other words, each row is a line in the text file.)
different files
Persistence is the term used to refer to the situation where the objects data is stored even after the object is destroyed or the application is closed. Persistence is implemented using Serialization where the data of the object is serialized into flat files and stored into the system. These files can be de-serialized to form the objects by using de-serialization.
Java does not require header files like C/C++.