IT 231: IT and Applications (BBA)
By the end of this session, you will be able to:
Definition: Storing data in a collection of separate, application-specific files.
Think of it like separate digital filing cabinets for each department. 🗄️
The same customer data is duplicated across departments.
customer_billing.csv
Contains: Name, Address, Bill
customer_contacts.txt
Contains: Name, Address, Phone
mailing_list.xls
Contains: Name, Address, Email
🔍 This separation created several major problems for organizations.
The same piece of information is stored in multiple places unnecessarily.
Example: A customer's address is stored in:
This wastes storage and requires multiple updates for a single change, leading to the next problem...
A direct result of redundancy. When data is not updated everywhere, it becomes inconsistent and unreliable.
A customer, Sita Rai, moves from Pokhara to Kathmandu.
Result: Which address is correct? The data cannot be trusted!
Data is scattered in different files with different formats, making it difficult to access and integrate.
Format: .xls
Format: .dat
Format: .csv
Challenge: How do you write one program to get a complete, 360-degree view of a customer?
Is it redundancy, inconsistency or isolation?
1. A hospital stores each patient's phone number in reception, lab and billing files. → Redundancy
2. Your bank statement shows your old address, but the mobile app shows the new one. → Inconsistency
3. A manager can't combine the sales Excel sheet with the accounting software's report. → Isolation
4. The college keeps your name in the library, exam and hostel files, and the hostel spells it "Bikas" instead of "Bikash". → Redundancy that led to inconsistency
Organizations needed a way to manage data that was centralized, consistent, and accessible.
The solution is to store all organizational data in a single, centralized location, managed by a specific software.
Database: A shared collection of logically related data.
Database Management System (DBMS): Software that controls the creation, maintenance, and use of a database (e.g., MySQL, Oracle, SQL Server).
Sales File
Acct. File
Mktg. File
...leads to...
Redundancy & Inconsistency
Sales App
Acct. App
Mktg. App
...all access...
📊 Central Database (via DBMS)
The database provides a "single source of truth" for the entire organization.
Imagine the old file-based system for vehicle ownership (the "blue book").
Problem: If you sell your scooter, the new owner's name might be updated at the Yatayat office but not in the Traffic Police's file. A traffic fine could be sent to you, the old owner! This is data inconsistency.
Solution: A modern, centralized database ensures all three departments see the same, up-to-date owner information from a single source.
A database model is a set of rules and standards that defines the logical structure of a database.
It determines how data is stored, organized, and manipulated.
Think of it as the blueprint for a database. 📐
Before the modern relational model became standard, data was organized differently. Let's explore two influential early models.
This model organizes data in a rigid, tree-like structure.
An evolution of the hierarchical model, offering more flexibility.
Developed by E.F. Codd in 1970, this model revolutionized how we think about data.
The relational model is the basis for almost all modern database systems we use today, including MySQL, PostgreSQL, and SQL Server.
Lesson: The best idea doesn't always win for the company that invented it. Oracle is still one of the largest database companies today.
It organizes data into simple, two-dimensional tables (also called relations).
Store data about a specific entity (e.g., `Students`, `Courses`).
Represent a single instance of that entity (e.g., one specific student).
Represent an attribute of that entity (e.g., `FirstName`, `CourseID`).
Imagine a simple database for our university.
| StudentID | FirstName | LastName |
|-----------|-----------|----------|
| 101 | Anjali | Thapa |
| 102 | Bikash | Shrestha |
| EnrollmentID | StudentID | CourseID |
|--------------|-----------|----------|
| 1 | 101 | IT231 |
| 2 | 102 | IT231 |
Tables are linked together using common fields called keys (like `StudentID`).
It uniquely identifies each row in its own table.
StudentID in Students, where 101 = Anjali and 102 = Bikash.
It's a field that points to the primary key of another table.
StudentID in Enrollments says which student took IT231.
The power of the relational model is unlocked with a special language.
SQL (Structured Query Language) is the standard language for managing and querying data in relational databases.
It allows for powerful, flexible, and easy-to-understand data manipulation.
SELECT FirstName FROM Students WHERE StudentID = 101;
-- Result: Anjali
Use the Students and Enrollments tables from the earlier slide.
1. SELECT LastName FROM Students WHERE FirstName = 'Bikash'; → Shrestha
2. SELECT COUNT(*) FROM Enrollments WHERE CourseID = 'IT231'; → 2
3. SELECT FirstName FROM Students WHERE StudentID = 103; → no rows, because there is no student 103
4. Write it yourself: list everyone's first name. → SELECT FirstName FROM Students;
Relational databases power many systems we use daily.
They use tables for `Users`, `Transactions`, and `Merchants`. Your transaction history is linked to your User ID, which is a key in the `Transactions` table.
Integrates data from different government bodies. It likely has tables for `Citizens`, `Documents` (like citizenship, PAN), and `Services`, all linked by a unique Citizen ID.
Hierarchical, network or relational?
1. Your computer's folders: C: → Users → Documents → IT231 → Hierarchical (every folder has one parent)
2. Airline routes: Kathmandu links to Pokhara, Delhi and Dubai, and each of those links to many more cities → Network (many-to-many links)
3. A bank's customers, accounts and transactions → Relational (tables linked by keys)
4. A company organisation chart → Hierarchical
5. Facebook friends → Network/graph
Short answer
Long answer
Revise the answers in the full notes linked on the last slide.
Questions before we wrap this hour?
Next: Unit 8 · Session 3 — Database Management Systems
📖 Read the full notes: Database vs. File System: Understanding the Difference · An Introduction to Database Models
Read first, then revise with this deck: