Database Management Systems - Complete Notes
Chapter 1: Introduction to Database Systems
1.1 Database Management Systems (DBMS)
Definition: A Database Management System is a software system that enables users to define, create,
maintain, and control access to databases.
Key Components:
Database: Collection of related data
DBMS Software: Programs that manage the database
Database Applications: Programs that interact with the database through DBMS
Characteristics of DBMS:
Data independence
Efficient data access
Data integrity and security
Data administration
Concurrent access and crash recovery
Reduced application development time
1.2 Comparison with File Systems
Aspect File System DBMS
High redundancy, same data stored multiple Minimal redundancy through
Data Redundancy
times normalization
Data Consistency Inconsistent data across files Maintains data consistency
Data Sharing Limited sharing capabilities Multiple users can access simultaneously
Multiple security levels (user, table,
Security File-level security only
column)
Data Independence Applications tightly coupled with data Physical and logical data independence
Automatic backup and sophisticated
Backup & Recovery Manual backup, limited recovery
recovery
Query Capability Limited search options Powerful query languages (SQL)
Concurrency Advanced concurrency control
No built-in concurrency control
Control mechanisms
Problems with File Systems:
Data redundancy and inconsistency
Difficulty in accessing data
Data isolation
Integrity problems
Atomicity problems
Concurrent access anomalies
Security problems
1.3 Actors on the Scene
Primary Users:
1. Database Administrators (DBAs)
Authorize access to database
Monitor database usage
Acquire software/hardware resources
Database tuning and performance monitoring
2. Database Designers
Identify data requirements
Design database structure
Choose appropriate storage structures
Define security policies
3. End Users
Naive Users: Use predefined applications (e.g., bank tellers)
Casual Users: Access database occasionally using query languages
Sophisticated Users: Use complex queries, may develop applications
Standalone Users: Maintain personal databases
4. System Analysts and Application Programmers
Determine requirements of end users
Develop specifications for transactions
Implement and test applications
1.4 Workers Behind the Scene
System Implementation Personnel:
1. DBMS System Designers and Implementers
Design and implement DBMS modules
Implement system interfaces
Ensure system efficiency and reliability
2. Tool Developers
Create tools for database modeling
Develop performance monitoring tools
Design user interfaces for database access
3. Operators and Maintenance Personnel
Responsible for running and maintaining systems
Perform system backups
Monitor system performance
1.5 Brief History of Database Applications
1960s - Early File Systems:
Hierarchical and network databases
IBM's IMS (Information Management System)
CODASYL network model
1970s - Relational Model:
Edgar Codd's relational model
System R project at IBM
Introduction of SQL
1980s - Commercialization:
Oracle, IBM DB2, Sybase
Personal computer databases
Object-oriented databases
1990s - Internet Era:
Web-enabled databases
Data warehousing
OLAP (Online Analytical Processing)
2000s - Modern Era:
XML databases
Open-source databases (MySQL, PostgreSQL)
NoSQL databases
2010s - Big Data Era:
Distributed databases
Cloud databases
NewSQL systems
1.6 When NOT to Use a DBMS
Scenarios where DBMS may not be suitable:
1. Simple, Well-defined Applications
Single-user applications
Applications with static data requirements
Simple file processing tasks
2. Cost Considerations
High initial investment in software/hardware
Cost of hiring specialized personnel
Training costs
3. Performance Requirements
Real-time applications requiring immediate response
Applications with simple data access patterns
4. Overhead Factors
High software overhead
Providing security, concurrency control, recovery
General-purpose functionality may be excessive
Chapter 2: Database System Concepts and Architecture
2.1 Data Models, Schemas, and Instances
Data Models:
1. Conceptual Data Models
High-level, semantic models
Entity-Relationship (ER) model
Enhanced ER (EER) model
UML class diagrams
2. Physical Data Models
Low-level models
Describe how data is stored
Record formats, file organizations
3. Implementation Data Models
Representational/logical models
Relational model
Network model
Hierarchical model
Object-oriented model
Schema vs Instance:
Schema: Description of database structure (metadata)
Database schema (complete description)
Schema diagram (visual representation)
Schema construct (component of schema)
Instance: Actual data stored at a particular moment
Database state/snapshot
Changes frequently
Must be valid state (satisfies schema constraints)
Three-Schema Architecture:
1. Internal Schema
Physical storage structure
Access paths and file organization
Storage details
2. Conceptual Schema
Logical structure for entire database
Entities, data types, relationships
Security and integrity constraints
3. External Schema/View
User views of database
Subset of conceptual schema
Customized for different user groups
2.2 Database Languages and Interfaces
Data Definition Language (DDL):
Define database schema
Create, alter, drop database objects
Specify storage structures and access methods
Example: CREATE TABLE , ALTER TABLE , DROP TABLE
Data Manipulation Language (DML):
Retrieve, insert, delete, modify data
Two types:
Procedural DML: Specify what data is needed and how to get it
Declarative DML: Specify what data is needed (SQL)
Database Interfaces:
1. Menu-Based Interfaces
Present options in menu format
Suitable for naive users
2. Forms-Based Interfaces
Display forms for data entry
Input/output forms for transactions
3. Graphical User Interfaces
Visual components (icons, menus, windows)
Point-and-click interactions
4. Natural Language Interfaces
Accept requests in natural language
Interpret and translate to database queries
5. Interfaces for Parametric Users
Function keys for standard operations
Customized for specific applications
6. Interfaces for DBA
Administrative functions
Database creation, backup, recovery
Performance monitoring
2.3 Database System Environment
DBMS Component Modules:
1. DDL Compiler
Processes DDL statements
Stores schema descriptions in catalog
2. Runtime Database Processor
Executes database operations
Query optimizer
Precompiler for embedded DML
3. Stored Data Manager
Controls access to stored data
Uses operating system services
4. Concurrency Control Subsystem
Ensures correct execution of concurrent operations
5. Backup and Recovery Subsystem
Handles database recovery from failures
Database Utilities:
Loading utility (bulk data loading)
Backup utility (database backup)
File reorganization utility
Performance monitoring utility
2.4 Centralized and Client/Server Architectures
Centralized Architecture:
Single computer system
All processing done on main computer
Users access via terminals
Simple architecture but limited scalability
Client/Server Architecture:
Two-Tier Architecture:
Client machines (user interface, application logic)
Server machine (database server, DBMS)
Direct communication between client and server
Advantages:
Better resource utilization
Improved performance through distribution
Scalability
Disadvantages:
Network overhead
More complex administration
Three-Tier Architecture:
Presentation Tier: User interface
Application Tier: Business logic/application server
Database Tier: Database server
Advantages of Three-Tier:
Separation of concerns
Better maintainability
Improved security
Load distribution
Web-Based Architecture:
Browser-based clients
Web server (middle tier)
Database server
HTTP/HTTPS communication
Distributed Databases:
Data distributed across multiple sites
Appears as single database to users
Challenges: data fragmentation, replication, concurrency
Key Takeaways for Engineering Students
1. Understand the fundamentals: DBMS provides structured, efficient, and secure data management
compared to file systems
2. Know the stakeholders: Different roles have different responsibilities in database systems
3. Grasp the architecture: Three-schema architecture provides data independence
4. Learn when to use DBMS: Not always the best solution; consider costs and requirements
5. Master the concepts: Data models, schemas, and instances are fundamental concepts
6. Understand system evolution: From centralized to distributed architectures reflects technological
advancement
7. Prepare for specialization: Whether as DBA, designer, or developer, each role requires specific skills
Study Tips
Practice drawing schema diagrams
Understand the difference between logical and physical data independence
Learn SQL as the primary database language
Study real-world database applications
Practice identifying when DBMS is appropriate vs. file systems