91热爆

Flat file databases

Flat file databases consist 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.

IDForenameSurnameDepartmentDepartment IDPhone number
1ColinArthurICT001300
2LauraBrownICT001300
3StephenMacLeodICT001300
4ScottSinclairEnglish002301
5MichelleWieEnglish002301
6RossDyettPE003302
7IanAndersonPE003302
8BettyFloodGeography004303
ID1
ForenameColin
SurnameArthur
DepartmentICT
Department ID001
Phone number300
ID2
ForenameLaura
SurnameBrown
DepartmentICT
Department ID001
Phone number300
ID3
ForenameStephen
SurnameMacLeod
DepartmentICT
Department ID001
Phone number300
ID4
ForenameScott
SurnameSinclair
DepartmentEnglish
Department ID002
Phone number301
ID5
ForenameMichelle
SurnameWie
DepartmentEnglish
Department ID002
Phone number301
ID6
ForenameRoss
SurnameDyett
DepartmentPE
Department ID003
Phone number302
ID7
ForenameIan
SurnameAnderson
DepartmentPE
Department ID003
Phone number302
ID8
ForenameBetty
SurnameFlood
DepartmentGeography
Department ID004
Phone number303

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