Database and file systems

Database concepts and how a database differs from a file system.

Computer Science/Informatics Practices5 questions

The essentials

A file system stores data in files managed by the operating system. Each application program usually keeps its own files, for example one file for fee records and another for attendance. A database is an organised collection of logically related data. A Database Management System (DBMS) is software used to create, store, update and retrieve data from a database, for example MySQL, Oracle, PostgreSQL and Microsoft Access.

Key points

  • Data redundancy: the same data (such as a student's address) is stored in many files, wasting space.
  • Data inconsistency: when redundant copies are updated in one file but not in another, the copies disagree.
  • Data isolation: data is scattered in files of different formats, so writing new programs to combine it is hard.
  • Data dependence: in a file system the structure of a file is built into the programs that use it, so changing the file means changing the programs.
  • Controlled sharing and security: a DBMS lets many users share data at the same time and lets the administrator give different access rights to different users.
  • A DBMS reduces redundancy and inconsistency by keeping data in one place, and supports queries through a language such as SQL.
  • Database schema: the design or structure of a database. Data dictionary: stores the schema (metadata). Database instance: the data stored at a particular moment. Query: a request to retrieve or change data.

Exam tips

  • Be ready to match a situation to a limitation: "address changed in the library file but not in the fee file" describes inconsistency, which is caused by redundancy.
  • Remember that metadata means "data about data", such as table names, column names and data types.

Common mistakes

  • Thinking a DBMS removes all redundancy. It reduces and controls redundancy; some is needed, for example foreign key values.
  • Confusing the schema (which changes rarely) with the instance (which changes whenever data changes).

Practice questions

Practice this topic