A database is an organised collection of related data, and a DBMS is the software that lets you store, find and change that data safely. This topic explains what that means, why it replaced plain files, and who works with a database.

Data, database and DBMS

Data means raw facts, such as the number 85 or the name "Ravi". Information is data that has meaning, such as "Ravi scored 85 in DBMS". A database is a collection of related data stored so that it can be searched and updated easily. A DBMS (Database Management System) is the software that creates the database, controls access to it and answers questions about it. MySQL, Oracle, PostgreSQL and MongoDB are all examples.

Definition: DBMS. Software that defines, stores, retrieves and protects the data in a database, and lets many users share it at the same time.

Where databases are used

  • Banking: accounts, balances and transactions.
  • Railway and airline booking: seats, fares and passengers.
  • Colleges: students, marks, attendance and fees.
  • Online shopping: products, orders, customers and payments.
  • Hospitals: patient records, appointments and bills.

File system versus DBMS

Before DBMSs, each program kept its own files. A college might keep student addresses in the library file, the fee file and the exam file separately. That causes trouble.

Problem with files How a DBMS helps
Same data repeated in many files (redundancy) Data is stored once and shared
Copies disagree after an update (inconsistency) One copy means one truth
Hard to ask new questions Query language such as SQL
No protection from wrong values Constraints and rules
Anyone with the file can read it Users, passwords and permissions
Crash can leave half-written data Transactions and recovery

Advantages and disadvantages

Advantages: less redundancy, consistent data, data sharing, security, integrity rules, backup and recovery, and independence of programs from the way data is stored.

Disadvantages: the software can be costly, it needs trained staff, the design takes time, and a failure of the central system affects every user. For a tiny, single-user task a plain file may be simpler.

Users of a database

  • Database administrator (DBA): installs the DBMS, gives permissions, takes backups and tunes performance.
  • Database designer: decides the tables and relationships.
  • Application programmer: writes programs that use the database.
  • End user: uses the system, for example a clerk entering marks or a customer checking an order.

Worked example

A college keeps student details in the fee office and the exam office as two separate files. A student changes address and only the fee file is updated. The exam office posts the hall ticket to the old address. This is inconsistency caused by redundancy. With one student table in a DBMS, the address is stored once and both offices see the new value.

Common mistakes

  • Treating "database" and "DBMS" as the same. The database is the data; the DBMS is the software.
  • Saying a DBMS removes all redundancy. It reduces it; some controlled duplication (for speed) can remain.

Practice questions

  1. Define data, database and DBMS.
  2. List four problems of a file-based system.
  3. Write any four advantages of a DBMS.
  4. Who is a DBA? State three duties.
  5. Give three applications of databases in daily life.

Answers to the practice questions

  1. Data is raw facts; a database is an organised collection of related data; a DBMS is the software that manages that database.
  2. Redundancy, inconsistency, difficult querying, weak security, no recovery after crashes.
  3. Less redundancy, consistency, sharing, security, integrity checks, backup and recovery.
  4. The Database Administrator manages the DBMS: gives user permissions, takes backups and restores data, and tunes performance.
  5. Bank accounts, railway ticket booking, online shopping orders (also hospitals, college results).

Sources

  • Official BCA syllabus Database Management Systems, course code CC202, Unit I
  • Raghu Ramakrishnan and Johannes Gehrke, Database Management Systems, 3rd edition, McGraw-Hill