Chapter 1: Introduction to Database Management System
1.1 What is a Database?
Data refers to raw, unprocessed facts and figures that by themselves carry little meaning. Data can be numbers, text, images, audio, or video. For example, 3.8 or "Abebe" alone is just data — it becomes information when we attach context: "Abebe has a GPA of 3.8."
A database is a very large, integrated, organized collection of related data stored electronically so it can be easily accessed, managed, and updated. It is used to maintain internal records, present data to clients on the web, and support commercial processes. Unlike a simple file or spreadsheet, a database enforces structure, rules, and relationships between data elements.
Formal definition: A shared, integrated collection of logically related data (and a description of this data) designed to meet the information needs of an organization.
Database Management System (DBMS): Software used to create, efficiently manage, and safely store large amounts of data over long periods.
Database System: DBMS + Database = Database System
Core focus of database systems: Organizing data, supporting multiple users, enabling efficient retrieval, ensuring secure/reliable storage, and maintaining consistent data.
| Property | Description |
|---|---|
| Persistent | Data survives after the program that created it terminates |
| Shared | Multiple users and applications can access the data concurrently |
| Interrelated | Data items have logical connections (e.g., a student is enrolled in a course) |
| Self-describing | The database contains both data and metadata (the description/schema of the data) |
1.2 The Evolution of Data Management
Data management has passed through three main stages:
- Manual Approach: Primitive filing cabinets with paper and cards.
- Limitations: Highly prone to error, difficult to update/retrieve data, and nearly impossible to cross-reference or integrate information.
- Traditional File-Based Approach: Each application defined and managed its own separate data files.
- Limitations: Limited data sharing, severe data redundancy (duplication), and update anomalies (errors during modification, deletion, or insertion of data).
- Database Approach: Data is organized logically as tables (relations) and shared throughout an organization.
- Key feature: Separates data definition from the application — applications are not affected by changes to the underlying data structure (Data Independence).
1.3 Database vs. File System
| Problem | File System | Database |
|---|---|---|
| Data Redundancy | Same data repeated in multiple files | Data stored once, shared across applications |
| Data Inconsistency | Copies may disagree after partial updates | Single source of truth, consistency enforced |
| Data Isolation | Data scattered in different files/formats | Centralized with uniform access |
| Integrity Issues | Hard to enforce constraints across files | Integrity constraints defined in the schema |
| Security | Difficult to control fine-grained access | Role-based access control built in |
| Concurrency | No built-in multi-user support | Transaction management with ACID properties |
1.4 Types of Databases
- Relational (RDBMS): Tables with rows and columns — PostgreSQL, MySQL, Oracle.
- NoSQL: Document (MongoDB), key-value (Redis), column-family (Cassandra), graph (Neo4j).
- Object-Oriented: Data stored as objects.
- Distributed: Data spread across multiple physical locations on a network.
- Cloud: Hosted on cloud platforms (AWS RDS, Google Cloud SQL, Azure SQL).
1.5 DBMS and Its Components
A DBMS enables users to define, create, maintain, and control access to a database. It sits between users/applications and physical storage.
Key functions:
- Data Definition — define schema using DDL
- Data Manipulation — insert, update, delete, retrieve using DML
- Data Control — security, integrity, concurrency using DCL
- Data Administration — backup, recovery, performance tuning, monitoring
The 5 pillars:
| Component | Description |
|---|---|
| Hardware | Servers, storage (HDD/SSD), RAM, network infrastructure |
| Software | DBMS engine, OS, application programs, network software |
| Procedure | Rules for login, backups, failure handling, security policies |
| Data | Operational data, metadata (data dictionary/system catalog), indexes |
| People | DBAs, designers, programmers, end users |
1.6 Database Languages
| Language | Purpose | Examples |
|---|---|---|
| DDL (Data Definition Language) | Define/modify schema | CREATE TABLE, ALTER TABLE, DROP TABLE |
| DML (Data Manipulation Language) | Query/modify data | SELECT, INSERT, UPDATE, DELETE |
| DCL (Data Control Language) | Control access/permissions | GRANT, REVOKE |
| TCL (Transaction Control Language) | Manage transactions | COMMIT, ROLLBACK, SAVEPOINT |
1.7 Benefits and Limitations
Benefits:
- Data Sharing — multiple users access the same data without redundant storage
- Improved Accessibility — users can query data without programming experience
- Data Independence — changes to storage structure don't affect application programs
- Minimal Redundancy — normalization reduces unnecessary duplication
- Integrity & Quality — constraints keep data accurate, valid, and consistent
- Security — fine-grained, role-based access control
- Centralization — all relevant organizational data managed from one repository
- Backup and Recovery — built-in protection against data loss
- Concurrent Access — multiple users work simultaneously without conflicts
Limitations:
- Complex to design, implement, and maintain — requires skilled personnel
- High initial cost (hardware, software, training, conversion from old systems)
- Performance overhead for simple operations
- Requires complex backup and recovery protocols
- Centralization creates a single point of failure with high organizational impact
1.8 Database Development Life Cycle (DDLC)
Systematic process for designing, implementing, and maintaining a database (analogous to SDLC):
Requirements → Conceptual Design (ER) → Logical Design (Schema)
→ Physical Design (Storage) → Implementation → Testing → Operation & Maintenance
Phases:
- Planning / Requirements Collection & Analysis — identify stakeholders, gather data and functional requirements. Output: Requirements Specification Document.
- Example (university): store students, courses, enrollments, generate transcripts.
- Analysis / Conceptual Design — ER modeling: entities, attributes, relationships, cardinality (1:1, 1:N, M:N). Output: ER Diagram.
- Logical Design — convert ER to relational schema, apply normalization (1NF–BCNF), define PKs/FKs/constraints.
- ER mapping: strong entity → table; weak entity → table with owner's PK; 1:1 → FK on either side; 1:N → FK on N-side; M:N → junction table; multivalued attribute → separate table.
- Physical Design — storage structures, indexes (B-tree/hash), partitioning, DBMS product choice. Output: DDL scripts.
- Implementation — run DDL, develop apps/UIs, load/migrate data, set up security.
- Testing & Evaluation — verify requirements, performance, security, user acceptance.
- Operation & Maintenance — monitor, tune, backup, schema changes, upgrades.
1.9 Roles in Database Design and Use
| Role | Responsibility |
|---|---|
| Database Administrator (DBA) | Oversees resources, authorizes access, manages schema, security, backup/recovery, performance, capacity planning |
| Database Designer (DBD) | Identifies what to store, chooses structures; logical designer produces ER/schema; physical designer handles indexes and storage |
| Systems Analyst | Bridge between users and dev team; gathers and documents requirements |
| Application Programmer | Writes code/interfaces (Java, Python, etc.) that access the database via SQL or ORMs |
| End Users | Access the database through applications or direct queries |
End user types:
| Type | Description | Example |
|---|---|---|
| Naive/Casual | Predefined interfaces, no queries | Student checking grades online |
| Sophisticated | Writes own SQL queries | Data analyst running reports |
| Specialized | Custom programs for complex needs | GIS developer |
| Stand-alone | Personal database use | Researcher using Access |
1.10 Data Abstraction (Three-Schema Architecture)
The ANSI/SPARC architecture provides three levels of abstraction:
EXTERNAL LEVEL (User Views)
↓
CONCEPTUAL LEVEL (Logical Schema — entities, relationships, constraints)
↓
INTERNAL LEVEL (Physical Storage — files, indexes, record formats)
| Level | Also called | Describes |
|---|---|---|
| External / View | Highest | How specific users see the data; different views for different roles |
| Conceptual / Logical | Middle | What data is stored and how entities relate; DBMS-independent |
| Internal / Physical | Lowest | How data is stored and indexed on disk |
Data Independence — modify a schema at one level without affecting the level above:
- Logical: change conceptual schema without breaking views/apps (e.g., add a column)
- Physical: change internal storage without changing logical schema (e.g., switch index type) — easier to achieve
1.11 Database System Architecture
1. Centralized DBMS — software, hardware, and user interfaces on a single system with specialized servers (file, print, web, email). Simple but limited scalability.
2. Two-Tier Client-Server — UI and application on the client; DBMS on the server. Client connects via an API (e.g., ODBC) over the network.
3. Three-Tier Client-Server — best for web apps:
- Tier 1 (Presentation): browser or mobile app
- Tier 2 (Application/Web Server): business logic, authentication
- Tier 3 (Database Server): data storage
The client never directly accesses the database — adds security, data encryption, and scalability through load balancing.
4. Distributed Architecture — data across multiple sites, each with its own DBMS, coordinated globally. High availability and fault tolerance; challenges include consistency and distributed transactions.
1.12 Key Terms (Exit Exam)
| Term | Meaning |
|---|---|
| Data | Raw, unprocessed facts |
| Information | Processed, meaningful data |
| Database | Organized collection of related data |
| DBMS | Software for managing databases |
| Schema | Structure/blueprint of a database |
| Instance | Data stored at a particular moment |
| Metadata | Data about data (system catalog) |
| DDL / DML / DCL | Definition / Manipulation / Control languages |
| Data Independence | Change one schema level without affecting the level above |
| ANSI/SPARC | Three-schema architecture standard |
| ER Model | Entity-Relationship model for conceptual design |
| Normalization | Organizing data to reduce redundancy (1NF–BCNF) |
| ACID | Atomicity, Consistency, Isolation, Durability |