Introduction to Management Information SystemsUnit 412 min read
Databases & Info Mgmt: DBMS, ERD, SQL, Data Warehousing & Analytics
Unit 4 of Introduction to Management Information Systems explores how businesses store, organize, and leverage data using database management systems (DBMS), entity-relationship modeling, SQL queries, data warehousing, and analytics to support decision-making and operational efficiency.
TAKEAWAYS:
- Understand the three-tier architecture of DBMS (user interface, application logic, and database engine) and how it ensures data integrity and security.
- Learn to design an ER diagram (entities, attributes, relationships) and convert it into a relational schema using normalization rules (1NF to 3NF).
- Master SQL commands (SELECT, INSERT, UPDATE, DELETE, JOIN) with real-world examples like querying customer orders in a retail system.
- Compare file-based systems vs. DBMS and relational vs. NoSQL databases using structured tables to highlight trade-offs.
- Apply data warehousing concepts (ETL, OLAP, star schema) to solve business intelligence problems like sales trend analysis for Daraz or Nabil Bank.
- Analyze ethical and security challenges in data management (e.g., GDPR compliance, data breaches in eSewa or Khalti).
1. What is a Database Management System (DBMS)?
A DBMS is software that manages databases by storing, retrieving, and manipulating data efficiently. It acts as an intermediary between users and the database, ensuring data integrity, security, and concurrency control.
Key Components of a DBMS
Advantages of DBMS Over File-Based Systems
| Feature | File-Based Systems | DBMS |
|---|---|---|
| Data Redundancy | High (duplicate data in multiple files) | Low (centralized storage) |
| Data Integrity | Poor (no validation rules) | High (constraints, transactions) |
| Concurrency Control | Manual (risk of conflicts) | Automatic (locking mechanisms) |
| Security | Weak (file-level permissions) | Strong (role-based access control) |
| Scalability | Limited (hard to expand) | High (supports large datasets) |
| Backup & Recovery | Complex (manual processes) | Streamlined (automated tools) |
2. Entity-Relationship (ER) Modeling
ER modeling is a visual tool to design databases by identifying:
- Entities (objects like
Customer,Product), - Attributes (properties like
customer_id,product_name), - Relationships (1:1, 1:M, M:N).
Steps to Create an ER Diagram
- Identify Entities: List all objects (e.g.,
Order,Supplier). - Define Attributes: Assign properties (e.g.,
Orderhasorder_id,order_date). - Determine Relationships: Use crow’s foot notation for cardinality.
- Convert to Relational Schema: Apply normalization.
Example: ER Diagram for a Retail Store (Daraz-like System)
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ PRODUCT : contains
ORDER ||--|| SUPPLIER : sourced_from
CUSTOMER {
int customer_id PK
string name
string email
}
ORDER {
int order_id PK
date order_date
int customer_id FK
}
PRODUCT {
int product_id PK
string product_name
float price
}
SUPPLIER {
int supplier_id PK
string supplier_name
}3. Normalization: Organizing Data Efficiently
Normalization reduces data redundancy and anomalies (update, insert, delete) by structuring tables into normal forms.
Normalization Rules (1NF to 3NF)
| Normal Form | Rule | Example Violation |
|---|---|---|
| 1NF | Each table cell contains a single value (atomicity). | Phone_numbers column storing "9800123456, 9812345678" |
| 2NF | No partial dependencies (all non-key attributes depend on the full PK). | Order table where product_price depends only on product_id, not the full PK. |
| 3NF | No transitive dependencies (non-key attributes must depend only on the PK). | Customer table where city depends on postal_code, not directly on customer_id. |
Worked Example: Normalizing a Student-Course Database
Unnormalized Table (Before 1NF):
| Student Name | Courses Enrolled (Redundant List) |
|---|---|
| Ram | Math, Physics, Chemistry |
| Sita | Math, Biology |
1NF (Atomic Values):
| Student Name | Course 1 | Course 2 | Course 3 |
|---|---|---|---|
| Ram | Math | Physics | Chemistry |
| Sita | Math | Biology | NULL |
2NF (Remove Partial Dependencies): Split into two tables:
- Students (
student_id,name) - Enrollments (
enrollment_id,student_id,course_id)
3NF (Remove Transitive Dependencies):
Ensure no non-key attribute depends on another non-key attribute (e.g., course_name should not be in the Enrollments table but in a separate Courses table).
4. SQL: Querying Databases
SQL (Structured Query Language) is used to retrieve, insert, update, and delete data.
Basic SQL Commands
-- Create a table
CREATE TABLE Customers (
customer_id INT PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(100) UNIQUE
);
-- Insert data
INSERT INTO Customers (customer_id, name, email)
VALUES (1, 'Ram', 'ram@example.com');
-- Select data (with JOIN)
SELECT Customers.name, Orders.order_date
FROM Customers
JOIN Orders ON Customers.customer_id = Orders.customer_id
WHERE Orders.order_date > '2023-01-01';
-- Update data
UPDATE Products
SET price = price * 1.1 -- 10% price increase (like Daraz's seasonal sale)
WHERE category = 'Electronics';
-- Delete data
DELETE FROM Orders
WHERE order_date < '2023-01-01';
Worked Example: Querying Nabil Bank’s Loan Data
Problem: Find all customers who took a home loan in 2023 with an interest rate > 8%.
SELECT customer_name, loan_amount, interest_rate
FROM Loans
WHERE loan_type = 'Home Loan'
AND YEAR(loan_date) = 2023
AND interest_rate > 8
ORDER BY interest_rate DESC;
5. Data Warehousing and Business Intelligence
A data warehouse stores historical, integrated data for analytical processing (OLAP).
Key Concepts
| Term | Definition | Example |
|---|---|---|
| ETL | Extract, Transform, Load: Process raw data into a usable format. | Daraz extracting sales data from multiple stores into a data warehouse. |
| OLAP | Online Analytical Processing: Supports complex queries (e.g., trends, forecasts). | NTC analyzing call data patterns to optimize network capacity. |
| Star Schema | A simple data warehouse model with one fact table and dimension tables. | Sales fact table linked to Product, Date, and Customer dimensions. |
Example: Data Warehouse for a Retailer (Like BigMart)
erDiagram
Fact_Sales ||--o{ Fact_Transaction : contains
Fact_Transaction }|--|| Dimension_Date : recorded_on
Fact_Transaction }|--|| Dimension_Product : sells
Fact_Transaction }|--|| Dimension_Customer : purchased_by
Dimension_Date {
date_id PK
year
month
day
day_of_week
}
Dimension_Product {
product_id PK
product_name
category
price
}
Dimension_Customer {
customer_id PK
customer_name
region
loyalty_status
}
Fact_Sales {
sale_id PK
transaction_id FK
product_id FK
customer_id FK
date_id FK
quantity
amount
}Star schema for retail data warehouse with fact and dimension tables6. NoSQL Databases: When Relational Isn’t Enough
NoSQL databases (e.g., MongoDB, Cassandra) are used for unstructured data or high scalability.
Comparison: Relational vs. NoSQL
| Feature | Relational Databases (SQL) | NoSQL Databases |
|---|---|---|
| Data Model | Tables (rows and columns) | Documents, Key-Value, Graphs, Wide-Column |
| Schema | Fixed (rigid structure) | Flexible (schema-less) |
| Scalability | Vertical (bigger servers) | Horizontal (distributed clusters) |
| Query Language | SQL (structured queries) | Varies (e.g., MongoDB Query Language) |
| Use Case | Transactional systems (banks, ERP) | Big data, real-time analytics (WhatsApp, Netflix) |
Real-World Example:
- WhatsApp uses Erlang + NoSQL to handle billions of messages in real-time.
- Nepal’s eSewa uses a relational database for secure financial transactions.
7. Ethical and Security Challenges in Data Management
Key Issues
- Data Privacy: Compliance with laws like GDPR (EU) or PDPA (Nepal).
- Example: Khalti must encrypt customer transaction data.
- Data Breaches: Unauthorized access (e.g., Daraz’s 2021 breach).
- Bias in Algorithms: AI-driven decisions (e.g., loan approvals) may discriminate.
- Intellectual Property: Protecting proprietary data (e.g., Coca-Cola’s recipe).
Best Practices
- Encryption: Use AES-256 for sensitive data (like Nabil Bank’s customer records).
- Access Control: Role-based permissions (e.g., only managers can delete orders in Daraz).
- Audit Logs: Track who accessed or modified data.
In the Real World
eSewa (Digital Payments)
- Idea Used: Relational Database + Transactions
- How: eSewa stores user transactions in a normalized database (1NF-3NF) to ensure ACID compliance (Atomicity, Consistency, Isolation, Durability). SQL queries validate payments in real-time.
Daraz (E-Commerce)
- Idea Used: Data Warehousing + OLAP
- How: Daraz’s ETL pipelines extract sales data from multiple warehouses, transform it into a star schema, and run OLAP queries to predict demand (e.g., "Which products sell best in Pokhara during Dashain?").
NTC (Telecom)
- Idea Used: NoSQL for Real-Time Analytics
- How: NTC uses Cassandra (NoSQL) to handle millions of call records per second, enabling real-time network optimization and fraud detection.
Nabil Bank (Loan Management)
- Idea Used: SQL + Normalization
- How: Nabil Bank’s loan system uses 3NF tables to store customer data, loan details, and interest calculations. A query like:
helps customers understand their Equated Monthly Installments (EMI).SELECT customer_name, loan_amount, (loan_amount * interest_rate/100 * months/12) AS EMI FROM Loans WHERE loan_type = 'Home Loan';
Exam Tip
Diagrams Are Worth Marks:
- Always draw ER diagrams for case studies (e.g., "Design a database for a hospital management system").
- Sketch star schemas for data warehousing questions.
SQL Queries Are Critical:
- Practice writing JOINs, subqueries, and aggregations (e.g., "Find the top 5 customers by total spending").
- Use real-world examples (e.g., "Write a query to find all orders placed after 6 PM for Pathao’s delivery system").
Normalization Shortcuts:
- For exam questions, stop at 3NF unless asked for BCNF.
- Memorize common anomalies (e.g., update anomaly in unnormalized tables).
Case Study Approach:
- If given a scenario (e.g., "Nepal’s traffic management system"), identify:
- Entities (Vehicles, Drivers, Routes),
- Relationships (1:M between Drivers and Vehicles),
- SQL Queries (e.g., "Find congested routes during peak hours").
- If given a scenario (e.g., "Nepal’s traffic management system"), identify:
Ethical Questions:
- Expect short-answer questions on:
- GDPR vs. PDPA,
- Risks of data silos (e.g., NTC and Ncell not sharing customer data),
- AI bias in hiring algorithms.
- Expect short-answer questions on:
Final Note: This unit is 50% theory (DBMS, ER modeling, normalization) and 50% applied (SQL, data warehousing, ethics). Focus on visuals (ERDs, star schemas) and hands-on SQL—they fetch the most marks!
Based on the PU BBA (PU) syllabus for Introduction to Management Information Systems, unit 4.
Discussion
Loading…