π 1. DBMS Concepts and Architecture Introduction
DBMS (Database Management System)
A DBMS is software that allows users to store, retrieve, manage, and manipulate data easily and securely.
Architecture of DBMS
Usually divided into three levels:
-
Internal Level: How data is stored physically.
-
Conceptual Level: The logical structure of the data.
-
External Level: How users view the data (multiple views for different users).
ποΈ 2. Database Approach vs Traditional File Accessing Approach
| Feature | Traditional File System | Database Approach |
|---|---|---|
| Data Storage | Separate files | Centralized database |
| Redundancy | High (same data in multiple files) | Low |
| Consistency | Hard to maintain | Easier |
| Data Access | Complex and less flexible | Easy via queries |
| Security | Limited | Strong and customizable |
| Backup & Recovery | Manual | Automatic |
β 3. Advantages of Database Systems
-
Reduces data redundancy
-
Improves data sharing
-
Maintains data integrity
-
Enhances security
-
Allows concurrent access
-
Supports backup and recovery
π§© 4. Data Models
A data model defines how data is structured, stored, and accessed.
Types:
-
Hierarchical Model β Data is organized like a tree.
-
Network Model β Data is organized in a graph (many-to-many relationships).
-
Relational Model β Data is stored in tables (rows and columns).
-
Object-Oriented Model β Data is stored as objects (like in OOP).
ποΈ 5. Schemas and Instances
-
Schema: Blueprint/design of the database (e.g., table names, fields).
-
Instance: Actual data stored in the database at a specific time.
Analogy:
-
Schema = building plan
-
Instance = actual building
π 6. Data Independence
The ability to change data storage or structure without affecting the application.
-
Logical Data Independence: Change in schema (like adding a new field) doesnβt affect programs.
-
Physical Data Independence: Change in how data is stored physically doesnβt affect logical structure.
π¬ 7. Database Language and Interfaces
-
DDL (Data Definition Language) β Defines database structure. E.g.,
CREATE TABLE. -
DML (Data Manipulation Language) β Used to insert, update, delete, and retrieve data. E.g.,
SELECT,INSERT. -
DCL (Data Control Language) β Controls access to data. E.g.,
GRANT,REVOKE. -
TCL (Transaction Control Language) β Manages transactions. E.g.,
COMMIT,ROLLBACK.
Interfaces:
-
Menu-based
-
Form-based
-
Graphical User Interface (GUI)
-
Query-based (e.g., SQL)
π§± 8. Overall Database Structure
Includes:
-
Tables
-
Views
-
Indexes
-
Stored procedures
-
Triggers
-
Users and permissions
π¨βπΌ 9. Functions of DBA and Designer
DBA (Database Administrator)
-
Maintain database performance
-
Backup and recovery
-
Manage users and security
-
Tune queries for performance
Database Designer
-
Design database schema
-
Identify entities and relationships
-
Decide data types and constraints
πΆ 10. ER Data Model
Entities and Attributes
-
Entity: Object or thing in the real world (e.g., Student, Book)
-
Attribute: Properties of the entity (e.g., Name, Roll No)
Entity Types
-
Strong Entity: Can exist independently.
-
Weak Entity: Depends on another entity.
π 11. Defining the ER Diagram
-
Rectangles β Entities
-
Ellipses β Attributes
-
Diamonds β Relationships
-
Lines β Connect entities and relationships
π 12. Generalization, Aggregation, and Specialization
-
Generalization: Combine similar entities into a single general one.
Example: Car + Bike β Vehicle -
Specialization: Break a general entity into specific ones.
Example: Employee β Engineer, Manager -
Aggregation: A relationship that itself has attributes.
Example: A project employs an employee for a specific duration.
π 13. Transforming ER Diagram into Tables
Steps:
-
Create a table for each entity.
-
Add attributes as columns.
-
Use primary keys to uniquely identify rows.
-
Use foreign keys for relationships.
π§ 14. Other Data Models
1. Object-Oriented Data Model
-
Stores data as objects (with attributes and methods).
-
Supports inheritance and encapsulation.
2. Network Data Model
-
Data is in records and connected via links (many-to-many relationships).
-
Faster for complex relationships, but hard to maintain.
3. Relational Data Model
-
Most widely used.
-
Data is stored in tables.
-
Easy to use, maintain, and scale.
βοΈ 15. Comparison of Data Models
| Feature | Relational | Network | Object-Oriented |
|---|---|---|---|
| Structure | Tables | Graph (records and links) | Objects (like in OOP) |
| Ease of Use | Easy | Complex | Medium |
| Flexibility | High | Low | High |
| Relationships | Easy via keys | Complex via pointers | Easy via references |
| Popularity | Very high | Low | Growing in specialized areas |