Flat file databases
A flat file database consists of one table. As a result, a large database will most likely have data which is unnecessarily repeated several times in the same table.
The table below holds data on teachers in a school. It also contains information about the department they work in.
ID | Forename | Surname | Department | Department ID | Phone number |
1 | Colin | Arthur | ICT | 001 | 300 |
2 | Laura | Brown | ICT | 001 | 300 |
3 | Stephen | MacLeod | ICT | 001 | 300 |
4 | Scott | Sinclair | English | 002 | 301 |
5 | Michelle | Wie | English | 002 | 301 |
6 | Ross | Dyett | PE | 003 | 302 |
7 | Ian | Anderson | PE | 003 | 302 |
8 | Betty | Flood | Geography | 004 | 303 |
ID | 1 |
---|---|
Forename | Colin |
Surname | Arthur |
Department | ICT |
Department ID | 001 |
Phone number | 300 |
ID | 2 |
---|---|
Forename | Laura |
Surname | Brown |
Department | ICT |
Department ID | 001 |
Phone number | 300 |
ID | 3 |
---|---|
Forename | Stephen |
Surname | MacLeod |
Department | ICT |
Department ID | 001 |
Phone number | 300 |
ID | 4 |
---|---|
Forename | Scott |
Surname | Sinclair |
Department | English |
Department ID | 002 |
Phone number | 301 |
ID | 5 |
---|---|
Forename | Michelle |
Surname | Wie |
Department | English |
Department ID | 002 |
Phone number | 301 |
ID | 6 |
---|---|
Forename | Ross |
Surname | Dyett |
Department | PE |
Department ID | 003 |
Phone number | 302 |
ID | 7 |
---|---|
Forename | Ian |
Surname | Anderson |
Department | PE |
Department ID | 003 |
Phone number | 302 |
ID | 8 |
---|---|
Forename | Betty |
Surname | Flood |
Department | Geography |
Department ID | 004 |
Phone number | 303 |
In this flat file database, the data on each member of staff is held together with all data for each department.
This is unnecessary as some information is stored more than once (eg the same phone number). This also results in an increased file size for the database. Using flat file databases can lead to three very specific problems:
- insert anomaly
- delete anomaly
- update anomaly