Learning Objectives

By the end of this chapter, you will be able to:

  • Define a database and a DBMS and separate data from software.
  • Explain three failures of file systems: redundancy, inconsistency, and weak control.
  • Name the five components of a database system and the three human roles.
  • List advantages and limitations of the database approach and when a file suffices.

Why a Mart Cannot Trust Its Own Files

A mini mart in Butwal keeps customers in three places. The till holds a sales sheet. The accountant holds a fee sheet. The owner holds a loyalty sheet. Sita changes her phone number. The till is updated. The other two sheets are not. The next offer SMS goes to the old number. The accountant calls the wrong number for a reminder. Each file looked correct alone. Together they contradicted each other.

The problem is architecture. Separate files copy the same fact and let it age differently. A database stores the fact once and lets many users read that one fact through rules.

Next in this unit: data concepts, database vs file system, models, DBMS, BI.

What a Database Is and What a DBMS Does

A database is an organized collection of related data stored so many users can retrieve it consistently. A DBMS is the software that creates, stores, updates, and retrieves that data under rules. Examples include Microsoft Access, MySQL, PostgreSQL, Oracle, and Microsoft SQL Server.

The database is the data. The DBMS is the software. Together with people and procedures they form a database system. A guest table with check-in dates is a database. MySQL that enforces room and date rules is the DBMS.

flowchart LR
  U[Users and apps: POS, property system, reports] --> DBMS[DBMS: enforces keys, controls access, backs up]
  DBMS --> DB[(Central database: one guest, one stock record)]
  FILES[Separate sheets] -. Copies .-> PROB[Redundancy and inconsistency]

Why files fail at scale

  • Redundancy. Same fact stored twice.
  • Inconsistency. Two values for the same fact.
  • No central control. Access and backup depend on who holds the file.
  • No standard language. Questions require hunting through sheets instead of a query.

A DBMS sits between users and the data. It defines structure, enforces keys so GuestID cannot repeat, controls access, and supports backup.

Office File Sita phone
Till sales.xls 9841-000111
Accounts fees.xls 9841-000111
Loyalty offer.xls 9851-000222

Only loyalty was updated. The firm now has three copies and two numbers. In a database the phone sits once in a Guests table keyed by GuestID and every report reads the same record.

The Five Components and the Three Roles

Group components by who controls them.

Content. Data: tables, rows, and columns.

Engine. Hardware: servers, disks, network. Software: DBMS plus apps built on it.

Direction. Users and procedures: who may do what and how backup runs.

Five components:

  1. Data. Tables, records, and fields.
  2. Hardware. Machines and storage.
  3. Software. DBMS and applications.
  4. Users. People who enter and view data.
  5. Procedures. Rules for entry, backup, and access.

Three roles:

  • End users. Clerks, cashiers, receptionists who enter and view data through forms.
  • Application developers. Build forms and reports that enforce steps such as no checkout without payment.
  • Database Administrator (DBA). Designs structure, grants access, tunes performance, plans backup. In a small mart the owner plays DBA informally. In a bank it is a dedicated role.

Self-check

Advantages and Limitations

Advantages Limitations
One copy of a fact, fewer contradictions Licences, servers, and skilled staff cost more
Many users share live data Design is more complex
Central security and access control One failure can pause many departments
Standard query language (SQL) for reports Needs backup and recovery planning
Integrity rules that block bad entries Small one-person tasks may not justify overhead

BI later in this unit depends on these advantages. Analysis is only as credible as the data it queries.

Nepal Worked Example: Hotel Check-in and Mini Mart Stock (NPR, BS 2081)

A 32-room hotel in Pokhara runs a property system on MySQL. On 2081-08-14:

  • Guest G-1842 checks into Room 204 for two nights at Rs 6,500 per night. Advance Rs 5,000. Balance Rs 8,000.
  • Restaurant sells 24 plates of dal bhat at Rs 450: revenue Rs 10,800. VAT at 13 percent included gives net Rs 9,557.52 and VAT Rs 1,242.48.
  • Kitchen issues 30 kg rice from stores. Opening stock 120 kg at Rs 140 per kg = Rs 16,800. New stock 90 kg = Rs 12,600.

In the file approach three sheets copy GuestID and drift apart by morning. In the database approach G-1842 exists once and a single query shows occupancy, revenue, and stock at midnight. If the clerk typed G-1482, the DBMS would block the posting because G-1482 does not exist. The file approach would accept it and create a ghost guest.

Summary

A database is related data stored once for many uses. A DBMS is the software that guards it. Files duplicate facts and let them diverge. Five components make a system: data, hardware, software, users, and procedures. Three roles keep it honest: end users, developers, and the DBA. With that discipline a hotel can post a room, a bill, and a stock issue and prove the same truth to auditor and manager.

Key Takeaways

  • Data lives once in a database. Copies create risk.
  • A DBMS enforces structure, keys, access, and backup.
  • Five components split into content, engine, and direction.
  • The DBA owns integrity and recovery.
  • Good analysis needs clean daily posting.

Discussion Questions

  1. Give one redundancy example from a hotel that keeps guest records in reception and accounting sheets.
  2. Who should be allowed to delete a member record in a cooperative database and what procedure would you require?
  3. Is Excel acceptable for a mart with one till and one user? At what point does it stop being enough?

Exercises

Short answer

  1. Define database and DBMS with one Nepal retail example of each.
  2. Explain redundancy and inconsistency with the Sita phone example.
  3. List the five components and three human roles.

Long answer

  1. The database approach overcomes file system limits. Discuss with a quantified Nepal business example and its correction.
  2. Explain roles of end users, developers, and the DBA using the hotel stock and billing cycle.