1.
Introduction, Characteristics of the
Database Approach
Introduction to DBMS
A Database is an organized collection of related data.
A DBMS (Database Management System) is software used to store, retrieve, and manage
data efficiently.
Why DBMS?
Before DBMS, data was stored using the File System, which caused problems like
redundancy, inconsistency, and difficulty in searching data.
Characteristics of the Database Approach
1. Self-Describing Nature of a Database System
o DBMS stores both data and metadata (data about data).
o Example: A table “Students” has columns (Roll No, Name, Course). Metadata
describes the column names and types.
2. Insulation between Programs and Data
o Applications do not need to know how data is stored.
o Data can change without modifying the entire program.
3. Support for Multiple Views of Data
o Users see only the required part of the database.
o Example: Teacher sees marks; Accountant sees fees.
4. Sharing of Data and Multiuser Transaction Processing
o Multiple users can access the data at the same time without conflict.
5. Control of Data Redundancy
o DBMS avoids duplicate data.
o Example: Student details stored once instead of in many files.
6. Data Integrity and Security
o Ensures correct data and prevents unauthorized access.
7. Backup and Recovery
o Automatically restores data after crashes.
2. Actors on the Scene, Workers behind the
Scene, Advantages of Using DBMS
Approach, File System vs Database
Actors on the Scene (Users of DBMS)
1. Database Administrators (DBA)
o Controls the entire database.
o Responsible for security, backup, performance.
2. Database Designers
o Decide how data will be stored and related.
3. End Users
a) Casual Users – use queries occasionally
b) Naive Users – ATM users, online form users
c) Sophisticated Users – Analysts, engineers
d) Stand-alone Users – Using personal databases like Excel
Workers Behind the Scene
1. DBMS System Designers – design DBMS software
2. Programmers – write application programs
3. System Analysts – decide system requirements
4. Maintenance Engineers – ensure software runs smoothly
Advantages of Using the DBMS Approach
1. Reduced Data Redundancy
2. Data Consistency
3. Better Data Security
4. Efficient Data Access
5. Concurrent Access
6. Backup & Recovery
7. Data Independence
8. Improved Decision Making
File System vs Database System
Feature File System Database System (DBMS)
Data Redundancy High Low
Data Security Low High
Data Sharing Difficult Easy
Data Consistency Hard to maintain Automatically maintained
Concurrency Not supported Supported
Data Independence No Yes
Backup & Recovery Manual Automatic
Example:
File system: Separate files for student marks, attendance → duplication.
DBMS: All stored in one database → no duplication.
3. Data Models, Schemas, and Instances,
Three-Schema Architecture, Data
Independence
Data Models
A data model describes how data is structured.
Types of Data Models
1. Hierarchical Model
o Data stored in tree structure.
o Example: Folder → Subfolder → Files.
2. Network Model
o Like hierarchical but supports many-to-many relations.
3. Relational Model (Most used)
o Data stored in tables (relations).
o Example: Student(RollNo, Name, Age).
4. Object-Oriented Model
o Data stored as objects.
5. Entity-Relationship (ER) Model
o Uses ER diagrams (entities, attributes, relationships).
Schemas and Instances
Schema: Structure of the database (design).
o Example: Definition of table Student(Name, Roll, Age).
Instance: Actual data stored at a moment.
o Example: Rows inside Student table.
Three-Schema Architecture
1. External Schema
o User view (what user sees).
2. Conceptual Schema
o Logical structure of the whole database.
3. Internal Schema
o Physical storage of data (files, indexes).
Diagram
External (Views)
↓
Conceptual (Logical)
↓
Internal (Physical)
Data Independence
Ability to change schema at one level without changing the next level.
Types
1. Logical Data Independence
o Change conceptual schema without affecting applications.
2. Physical Data Independence
o Change storage structure without affecting conceptual schema.
4. Database Languages and Interfaces
Database Languages
1. DDL (Data Definition Language)
o Used to define structure.
o Example:
o CREATE TABLE Student(Id INT, Name VARCHAR(20));
2. DML (Data Manipulation Language)
o Used for inserting, updating, deleting.
o INSERT INTO Student VALUES(1, 'Ali');
3. DCL (Data Control Language)
o Controls access
o GRANT SELECT ON Student TO user1;
4. TCL (Transaction Control Language)
o Manages transactions.
o COMMIT;
o ROLLBACK;
5. Query Language
o Mainly SQL.
Interfaces
1. GUI Interfaces – phpMyAdmin, MySQL Workbench
2. Form-based Interfaces – Online applications
3. Menu-driven Interfaces – ATM machines
4. Command-line Interfaces – SQL command prompt
5. Natural Language Interfaces – AI-based queries (future)
5. Structured, Semi-Structured, and
Unstructured Databases
1. Structured Database
Data stored in tables (rows & columns).
Defined schema.
Example: MySQL, Oracle, PostgreSQL.
Example
Student Table
Roll Name Age
1 Ram 20
2. Semi-Structured Database
Data does not follow strict table format.
Uses tags or flexible structure.
Examples
XML
JSON
NoSQL (MongoDB)
Example (JSON)
{
"name": "Rahim",
"age": 22,
"skills": ["Python", "SQL"]
}
3. Unstructured Database
Data has no identifiable structure.
Hard to search.
Examples
Images
Videos
Audio files
Email text
Social media posts
Stored using
Hadoop
Data Lakes