4.2.2 The limitations of flat databases

Cards (13)

  • Our simple database appears to do a good job: it is easy to find individual students and the courses they study
  • If everything remained unchanged, this database would be perfectly adequate for our purposes
  • We'd quickly encounter problems if we added new data or needed to change values of previously stored data
  • Constructing a database requires careful thought about the way information is organised and used
  • Adding fields
    1. Delia Edwards wants to study woodwork as well as the three courses she is already taking
    2. Current table can only accommodate students taking three courses
    3. Add another field to accommodate Delia
    4. Consider adding more fields for potential future needs
  • Problems with adding many fields

    • Empty fields occupy memory
    • Queries run more slowly on large tables than smaller tables, even when largely empty
  • We could use a faster computer to overcome these deficiencies
  • Repeating data in a database

    • Uses extra memory
    • Changing data or correcting errors requires finding and editing every repetition in the table
  • Digital photography will be extended from 10 to 15 weeks
    Incorporating this amendment in College_Table requires updating several student records
  • We can't simply rely on search and replace to alter every occurrence of 10 to 15, since Yoga also runs for 10 weeks and its length does not need to change
  • Instead, we need to check every record in the database – a time-consuming and error-prone process
  • Ideally, information about the number of weeks would be recorded in just one place, and editing Digital photography would involve changing a single record
  • This is the principle behind the so-called relational database, which we will explore in the next section