Flat File Database: Definition & Example

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: Flat File Database vs. Relational Database

You're on a roll. Keep up the good work!

Take Quiz Watch Next Lesson
 Replay
Your next lesson will play in 10 seconds
  • 0:04 What is a Flat File Database?
  • 1:19 Flat File Database Examples
  • 3:23 Flat File Database Drawbacks
  • 3:58 Lesson Summary
Add to Add to Add to

Want to watch this again later?

Log in or sign up to add this lesson to a Custom Course.

Login or Sign up

Timeline
Autoplay
Autoplay

Recommended Lessons and Courses for You

Lesson Transcript
Instructor: Martin Gibbs

Martin has 16 years experience in Human Resources Information Systems and has a PhD in Information Technology Management. He is an adjunct professor of computer science and computer programming.

This lesson will define and explain flat file databases; examples will be provided. While most database administrators strive to create relational databases, there are valid uses for flat file databases.

What Is a Flat File Database?

If you ask some database administrators (DBAs) about flat file databases, they may wonder if you just told them the world was flat. That's because flat file databases can become unwieldy and complicated. However, they have a use and a purpose, as will be detailed in this lesson.

A flat file database is basically a giant collection of data in which the tables and records have no relation between any other tables. In fact, one could have a single table (e.g., My Small Business Data) with everything stored in it, from customers to sales to orders to invoices.

Sound too messy? Often it is. But there are uses. One doesn't necessarily have to normalize a database. By normalize, we mean break out all the repeating values in tables and save them into other, related tables. Sometimes simple is best.

In fact, if the data set is fairly simple, the flat file option makes more sense. A CD collection, a list of cell phone numbers, or results from a 10k could be stored in a flat file database. Even a web page or computer program could be written to interact with these types of databases; in fact, from a developer's perspective, it would be easy to maintain.

Flat File Database Examples

If you have ever created an Excel spreadsheet, you have created a basic flat file! A workbook with multiple tabs makes up the database of the flat-file database; there could be many values that are the same in both worksheets, but they are not linked together.

The database table (yes, it is just a snippet from Excel) shown in the image below could be used in a small web application for a running a club:

Flat File Example
flat file example

You will notice that some names repeat; for a small table this is not that big of a deal. However, if you wanted to change the record for Dave and add a last name, you have to find all records for him and update each one.

This lesson's author, when starting a career in information technology, was given the task of creating a database to track all printers for a given department. He generated an overly complex relational database with over 25 tables. When presented to a colleague, the colleague replied: 'Why not just make a flat file?' This turned out to be the simplest solution; although it was a large file, it wasn't unwieldy and was user-friendly. Using Microsoft Access, a simple user form was created, and no special coding or updates to related tables were needed.

Relational databases use primary and foreign keys to index the data. A flat file database table can still use an index; however, it's specific only to that table. An index is usually an auto-generated number that identifies the record number in the table, usually starting at 1. The small flat database table below has an index:

Example of a Flat File Database Table
flat database table

Even though flat file databases don't have relationships between the tables within them, the tables should still contain an index, which aids in searching and organizing.

To unlock this lesson you must be a Study.com Member.
Create your account

Register for a free trial

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Free 5-day trial

Earning College Credit

Did you know… We have over 160 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it free for 5 days!
Create An Account
Support