Unit 5 Session 1: Databases and Data Concepts | IT 231 Slides

--:-- --
↓ Scroll for more

Unit 5 · Session 1

Databases and Data Concepts

IT 231: IT and Application (BBM)

Learning Objectives

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

  • ✅ Define what a database is and its importance in modern information systems.
  • ✅ Identify the key problems associated with traditional file-based systems.
  • ✅ Explain the database approach and the central role of a Database Management System (DBMS).

Learning Objectives (cont.)

  • ✅ Recognize different database models and the role of Business Intelligence.
  • ✅ Describe the data hierarchy from character to database.
  • ✅ Differentiate between data, information, and knowledge, and apply them to real-world examples.

The Core of Modern IT

What is a Database? 📊

A database is a structured, organized collection of data, stored and accessed electronically. Think of it as a highly efficient digital filing cabinet.

The ability to store, manage, and retrieve data efficiently is critical for any organization, from a small startup to a global enterprise.

Before databases: one card per book

A wooden library card-catalogue chest with many small labelled drawers

📱 Poll: How Many Databases Know You?

Take 1 minute. List every organisation that holds a record about you in a database. Think about:

  • 📶 Your SIM card (NTC or Ncell keep your ID details)
  • 🏦 Your bank and digital wallet
  • 🎓 Your college and the university exam office
  • 🏥 A hospital or clinic you've visited
  • 📲 Social media, ride-sharing and shopping apps

Hands up if you listed more than 10. Each of those is a database, and each one stores your name in its own way.

The "Old Way": Traditional File Systems

Before databases, data was stored in separate, application-specific files.

Icon of separate file folders

This led to major problems:

  • 🔴 Data Redundancy: Same data duplicated in multiple files.
  • 🔴 Data Inconsistency: Duplicated data becomes out of sync.
  • 🔴 Data Isolation: Difficult to access data from different applications.
  • 🔴 Security Issues: Hard to enforce consistent security policies.

The "New Way": The Database Approach

The database approach centralizes data, treating it as a shared organizational resource.

⚡ Key Idea: A single, integrated repository of data is managed by a controlling agent, the DBMS.


Diagram showing a central database with multiple applications accessing it

File System vs. Database Approach

File-Based System

  • Decentralized data
  • Data dependent on application
  • High redundancy
  • Low security & integrity

Database Approach

  • Centralized data
  • Data independence
  • Controlled redundancy
  • High security & integrity

🧪 Quick Check: File or Database?

Which approach fits each case? Give one reason.

1. A teacher's own marks sheet for one class → A file is fine: one user, small data, nothing shared.

2. A bank with 50 branches and a mobile app → Database: many users at once, security, no duplicate balances.

3. An online shop's orders, stock and payments → Database: the same data is shared by sales, store and accounts.

4. Your personal shopping list → A file (or paper) is fine: a DBMS would cost more than it saves.

🌍 Real Case: The Spreadsheet That Lost 15,841 COVID Cases (2020)

  • England's health agency (PHE) collected lab results as text files and loaded them into Excel templates in the old .xls format.
  • An .xls sheet holds at most 65,536 rows. Each test used several rows, so a template held only about 1,400 cases. Extra rows were silently cut off.
  • Result: 15,841 positive cases (25 Sep to 2 Oct 2020) were missing from the daily figures, and their contacts were traced late.

Lesson: a spreadsheet is a file, not a database. A DBMS would have stored every row, or rejected the load with an error.

The "Brain": Database Management System (DBMS)

What is a DBMS? 🧠

A Database Management System (DBMS) is the software that interacts with users, applications, and the database itself to capture and analyze data.

It's the gatekeeper that manages everything related to the database.

Examples: MySQL, PostgreSQL, Oracle, Microsoft SQL Server, MongoDB

🎬 What Is a Database?

Key Functions of a DBMS

  • 🎯 Data Definition: Creating and defining the database structure (tables, fields, relationships).
  • 🎯 Data Manipulation: Inserting, updating, deleting, and querying data (CRUD operations).
  • 🎯 Data Security: Enforcing user permissions and preventing unauthorized access.
  • 🎯 Concurrency Control: Managing simultaneous access by multiple users.
  • 🎯 Backup & Recovery: Protecting data from loss or corruption.
  • 🎯 Data Integrity: Enforcing rules to maintain data accuracy and consistency.

🧩 Five Components of a Database System

A database system is more than the data. It has five parts that work together.

  • 🖥️ Hardware: the servers, storage disks and network that hold and move the data.
  • 💿 Software: the DBMS itself (e.g. MySQL), the operating system and the application programs.
  • 📊 Data: the stored facts, plus the metadata that describes them (table and field definitions).
  • 📋 Procedures: the rules for using the system: how to log in, take backups, and restore after a failure.
  • 👥 People: everyone who designs, runs or uses the database.

Exam tip: list all five and give one example of each.

👥 Who Uses a Database?

End Users

Use the data through apps and forms, without seeing the tables.

e.g. a bank teller, or you checking your balance in an app.

Application Developers

Write the programs and screens that read and update the database.

e.g. the team that builds a wallet app's payment screen.

Database Administrator (DBA)

Designs and looks after the database: access rights, backups, recovery and performance.

e.g. the IT officer who restores data after a crash.

Blueprints: Database Models

A database model defines the logical structure of a database. It determines how data is stored, organized, and manipulated.

Relational Model

Data in tables (rows/columns). The most common model. (e.g., MySQL)

Hierarchical Model

Tree-like structure with parent-child relationships.

NoSQL Models

Flexible models for big data. (e.g., Document, Key-Value, Graph)

We will explore these in more detail later in the unit.

From Data to Decisions: Business Intelligence (BI)

🔍 What is Business Intelligence?

BI refers to the technologies, applications, and practices for the collection, integration, analysis, and presentation of business information. The purpose of BI is to support better business decision-making.

Databases are the foundation of BI. They store the raw data that BI tools turn into actionable insights, reports, and dashboards.

Databases in the Real World

Where do you see databases in action?

🇳🇵 Example from Nepal: eSewa

  • User Data: Your profile, name, phone number, KYC details.
  • Transaction Data: Every payment, transfer, and top-up is a record.
  • Merchant Data: Information about businesses you can pay.

A powerful DBMS manages millions of these transactions securely and instantly.

Other examples: Your university's student information system, Daraz's product catalog, a hospital's patient records.

🌍 Real Case: Estonia's X-Road

  • Estonia's government offices each keep their own database (population register, tax, health, driving licences…).
  • Since December 2001, a secure data-exchange layer called X-Road lets those databases ask each other for data instead of keeping copies. Every exchange is encrypted, signed and logged.
  • Citizens give a fact such as their address once; other offices read it from the source (the "once-only" idea).

Think: which file-system problems does this avoid? → Redundancy (no extra copies) and inconsistency (one up-to-date source).

Key Takeaways

  • A database is an organized collection of data, solving the problems of old file-based systems.
  • The Database Approach centralizes data, making it a shared, manageable resource.
  • A DBMS is the essential software that manages the database, ensuring security, integrity, and accessibility.
  • Database models provide the blueprint for data structure, while Business Intelligence turns that data into valuable insights.
  • The Data Hierarchy provides a logical structure: Character → Field → Record → File → Database.
  • Data is raw facts, Information is data given context, and Knowledge is actionable insight derived from that information.

Exam Practice: Short Answer

  1. Define database and DBMS with one example each.
  2. What is data redundancy? How does it lead to inconsistency?
  3. List the five components of a database system.
  4. Define field, record, and file with examples.
  5. What is a primary key? Why can a name not be a primary key?
  6. Differentiate between data and information.

Exam Practice: Long Answer

  1. “The database approach overcomes the limitations of the traditional file system.” Discuss with a suitable business example.
  2. Explain the roles of end users, application developers, and the database administrator in an organization.
  3. Explain the data hierarchy with an example of a bank or college database.
  4. Explain data, information, and knowledge. What are the characteristics of good-quality data?

Revise the Introduction to Databases and Data Concepts notes before writing these answers.

The Data Hierarchy 📊

In computing, data isn't just a random mess. It's organized in a logical pyramid or hierarchy.

Think of it like building with LEGOs: you start with the smallest bricks and build up to a complete structure.

Character → Field → Record → File → Database

Level 1 & 2: The Building Blocks

1. Character

The most basic logical element.

  • A single letter: S
  • A single number: 9
  • A single symbol: @

2. Field (Attribute)

A group of related characters representing a characteristic of an entity.

  • First Name: Sita
  • Price: 1500
  • Email: sita@example.com

🔤 Data Types: What Kind of Field Is It?

Every field has a data type. It tells the DBMS what values are allowed.

Text: FirstName = Sita

Whole number: StudentID = 10123

Decimal number: Price = 1500.50

Date: AdmissionDate = 2024-09-15

Yes/No: FeePaid = Yes

❓ Phone number: number or text? Text. We never do maths on it, and it can start with 0 or +977.

Level 3: The Entity

Record: A collection of related fields that describe a single entity (a person, place, thing, or event).

Example: A Student Record

Field: StudentID → Value: 10123

Field: FirstName → Value: Anjali

Field: LastName → Value: Gurung

Field: Major → Value: BSc.CSIT

🔑 The Primary Key: A Unique ID for Every Record

A primary key is a field (or a combination of fields) whose value is unique for every record and is never empty.

  • Your college has two students called Sita Rai. Which one passed? A name can't tell them apart.
  • So the college gives each one a StudentID (10123 and 10456). That's the primary key.
  • Good keys are unique, never blank, and don't change. A phone number is a poor key, because people change numbers.

Real-world keys: a citizenship number, a bank account number, a vehicle registration number, or a product SKU.

🧪 Activity: Pick the Primary Key

For each table, which field should be the primary key?

1. Students: Name, Phone, StudentID, Address → StudentID

2. Vehicles: Owner, Colour, Registration number, Model → Registration number

3. Products: Name, Price, SKU code, Brand → SKU code

4. Bank accounts: Holder name, Branch, Account number → Account number

5. Employees: Name, Email, Date of birth, EmployeeID → EmployeeID (people can change their email address)

6. Flights: Flight number, Date, Pilot → Flight number + Date together. The same flight number flies every day, so one field isn't enough. This is a composite key.

🧮 Worked Example: A Data Dictionary for the Students Table

Before any data goes in, the designer describes every field. This "data about data" is metadata.

StudentID · whole number · 5 digits · primary key, required

FirstName · text · up to 20 characters · required

Phone · text · exactly 10 digits

AdmissionDate · date · cannot be in the future

FeePaid · yes/no · starts as "No"

  • The DBMS keeps this list in its data dictionary (system catalogue).
  • ❓ Someone types Phone = 98-41. What happens? → The DBMS rejects it: not 10 digits.

Level 4 & 5: The Collections

4. File (or Table)

A collection of related records.

Example: A `Students.csv` file would contain the records for all students in the university.

5. Database

An integrated collection of related files (tables).

Example: A `UniversityDB` would contain the `Students` file, `Courses` file, and `Faculty` file, all linked together.

Visualizing the Hierarchy

From a single character to an entire database.

DATABASE: UniversityDB
FILE (TABLE): Students
RECORD: [10123, Anjali, Gurung, BSc.CSIT]
FIELD: FirstName: "Anjali"
CHARACTER: 'A'

🧪 Activity: Climb the Hierarchy

A bank keeps customer accounts. Name the level of each item.

1. The letter R in "Ram" → Character

2. AccountNo: 0012345 → Field

3. [0012345, Ram Shrestha, Savings, Rs 52,000] → Record

4. All the bank's customer accounts → File (Table)

5. Accounts + Loans + Transactions, linked together → Database

🧮 Worked Example: How Big Is a Student Database?

Extension · if time permits

In English text, one character usually takes 1 byte.

One record

  • StudentID 10 + First name 20 + Last name 20
  • Major 20 + Phone 10 + Email 40
  • = 120 bytes per record

The whole file

  • 20,000 students × 120 bytes = 2,400,000 bytes
  • = 2.4 MB, which is smaller than one phone photo!

Nepali twist: Devanagari letters take 3 bytes each in the common UTF-8 encoding. So "सीता" (4 characters) needs 12 bytes, while "Sita" needs only 4.

Beyond Structure: The Value of Data

Organizing data is the first step. The real goal is to create meaning.

This leads us to the crucial difference between three key terms...

Data ➡️ Information ➡️ Knowledge

From Data to Wisdom: The DIKW Pyramid

DIKW pyramid with data at the base, then information, knowledge and wisdom at the top

🔍 Data vs. Information vs. Knowledge

Data

Raw, unorganized facts. Meaningless on its own.

45

NPR

Momo

Information

Data organized into a meaningful context.

"The price of one plate of momo is NPR 45."

Knowledge

Actionable insights derived from information.

"By pricing our momos at NPR 45, we are 10% cheaper than competitors, which could increase our sales volume."

One plate, NPR 45: data, information or knowledge?

A plate of Nepali momo dumplings arranged around a bowl of achar

✅ Characteristics of Good-Quality Data

Decisions are only as good as the data behind them.

  • Accurate: free of errors (the price really is NPR 45, not 54).
  • Complete: nothing important is missing (every sale has a date).
  • Timely: up to date when you need it (today's stock, not last month's).
  • Relevant: useful for the decision being made.
  • Consistent: the same fact matches everywhere it is stored.

Garbage in, garbage out: a fast database full of bad data still gives bad answers.

🧪 Activity: Which Quality Problem Is It?

Accurate, complete, timely, relevant or consistent: which one is missing?

1. A customer's age is stored as 245. → Accurate

2. Half of the sales records have no date. → Complete

3. Last month's stock report is used to reorder today. → Timely

4. Sales says "Bikash", Accounts says "Bikas". → Consistent

5. Favourite colour is used to set a customer's loan limit. → Relevant

🌍 Real Case: A Spacecraft Lost to Missing Units (1999)

  • NASA's Mars Climate Orbiter (about US$125 million) was steered using thruster data sent from Earth.
  • One team's software reported the numbers in pound-force seconds (US units). The navigation team's software read them as newton-seconds (metric).
  • The small error added up over months. On 23 September 1999 the orbiter flew far too close to Mars and was lost.

Lesson: 1 pound-force second = 4.45 newton-seconds, so every value was off by that factor. A number without its unit is only data; with an agreed unit it becomes information.

Mars Climate Orbiter, lost 23 September 1999

Artist's depiction of NASA's Mars Climate Orbiter spacecraft in orbit above Mars

Practical Application: A Daraz Seller

Let's apply this to a real-world scenario in Nepal.

Data Point 📊

150, "Laptop Bag", "Pokhara", "2023-11-10"


Information ℹ️

On November 10th, 2023, 150 units of "Laptop Bag" were sold to customers in Pokhara.


Knowledge 💡

Sales of laptop bags in Pokhara tripled during the Gandaki IT Fair. For the next fair, we should pre-stock inventory in our Pokhara hub and run targeted ads to capitalize on this trend.

🧪 Activity: Data, Information, or Knowledge?

1. "2,40,000" Data

2. "Our New Road shop sold Rs 2,40,000 of goods in Dashain week" Information

3. "Dashain week sales are double a normal week, so hire 2 temporary staff next year" Knowledge

4. "Kathmandu, 31, 14:00" Data

5. "Only 12 units of the blue school bag are left in stock" Information

6. "At this rate we run out by Friday, so reorder today" Knowledge

💬 Discussion Questions

  1. Your college still keeps attendance in separate Excel files for each teacher. What problems might that cause at exam time?
  2. Why might your citizenship number make a better primary key than your phone number, but a worse one to show on a public result list?
  3. A momo shop records every sale. Give one example of data, information and knowledge it could get from those records.

Image & Video Credits

Images

  • File-folder icon and central-database diagram (it231_file_folders.webp, it231_database_apps.webp): existing course slide assets, Arjan KC
  • "Wooden Card Catalog Furniture.jpg": MarkBuckawicki, CC0, via Wikimedia Commons
  • "DIKW Pyramid.svg": Longlivetheux, CC BY-SA 4.0, via Wikimedia Commons
  • "Nepali Momo.jpg": Rabin Tuladhar, CC BY-SA 4.0, via Wikimedia Commons
  • "Mars Climate Orbiter - artist depiction": NASA/JPL, Public domain, via Wikimedia Commons

Videos (YouTube)

  • IBM Technology, "What is a Database?" (0:03–1:08), https://www.youtube.com/watch?v=hRulZhTtUTg

Teaching content © Arjan KC. Third-party media remain the property of their owners.

Thank You!

Questions?

📖 Read first (chapter notes)