Database Management Systems: Core Concepts and Functions
Advantages of DBMS
- Reduces Data Redundancy: DBMS avoids duplication of data. The same data is stored only once, which saves storage space.
- Improves Data Consistency: When data is updated in one place, it is automatically updated everywhere, ensuring consistency.
- Data Security: DBMS provides security by allowing only authorized users to access or modify data.
- Data Sharing: Multiple users can access and share the same database simultaneously.
- Data Integrity: DBMS ensures data accuracy and reliability through rules and constraints.
- Backup and Recovery: DBMS provides features to protect data from system failures or crashes.
- Easy Data Access: Users can easily retrieve and manage data using query languages like SQL.
Disadvantages of File Processing Systems
- Data Redundancy: The same data may be stored in multiple files, causing duplication and wasting storage space.
- Data Inconsistency: Updating one file while others remain unchanged leads to incorrect data.
- Data Isolation: Data stored in separate files and formats makes it difficult to combine information.
- Security Problems: File systems lack strong security, making data vulnerable to unauthorized access.
- Difficult Data Access: Retrieving specific data is time-consuming without a proper query system.
- No Backup and Recovery: Data loss due to system failure is often permanent.
- Lack of Data Integrity: File systems do not enforce rules to ensure data accuracy.
Common Data Models
1. Hierarchical Data Model
- Data is organized in a tree-like structure.
- Each parent record can have many children, but each child has only one parent.
- Represents one-to-many relationships.
2. Network Data Model
- Data is organized in a graph structure.
- A child record can have multiple parent records.
- Supports many-to-many relationships.
3. Relational Data Model
- Data is stored in tables (relations).
- Contains rows (records) and columns (attributes).
- Tables are connected using primary and foreign keys.
4. Object-Oriented Data Model
- Stores data as objects containing data and methods.
- Useful for complex applications like multimedia systems.
5. Entity–Relationship (ER) Model
- Represents data using entities, attributes, and relationships.
- Used for database design and visualization.
Database Commands (DDL, DML, DCL, TCL)
1. DDL (Data Definition Language)
Used to define and modify the database structure.
Examples: CREATE, ALTER, DROP, TRUNCATE
2. DML (Data Manipulation Language)
Used to insert, update, delete, and retrieve data.
Examples: INSERT, UPDATE, DELETE, SELECT
3. DCL (Data Control Language)
Used to control access and user permissions.
Examples: GRANT, REVOKE
4. TCL (Transaction Control Language)
Used to manage database transactions.
Examples: COMMIT, ROLLBACK, SAVEPOINT
Role of a Database Administrator (DBA)
- Installation and Setup: Configures DBMS software.
- Database Design: Manages schemas and relationships.
- Security Management: Controls user access and permissions.
- Backup and Recovery: Performs regular data restoration tasks.
- Performance Monitoring: Optimizes queries for speed.
- Data Integrity: Ensures data remains accurate and reliable.
- User Management: Creates and manages user accounts.
Types of Database Users
1. Database Administrator (DBA)
Manages the entire system, including security and maintenance.
2. Application Programmers
Write programs that interact with the database using languages like Java or Python.
3. Naive Users (End Users)
Interact via applications without knowing database internals (e.g., ATM users).
4. Sophisticated Users
Write direct SQL queries to retrieve or analyze data.
5. Specialized Users
Develop complex applications like AI or scientific systems.
