Essential Database Concepts and Administration
Database Normalization
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. It divides large tables into smaller tables and establishes relationships between them.
Objectives of Normalization
- Remove data redundancy (duplicate data).
- Improve data consistency.
- Make database structure efficient.
- Avoid update, insert, and delete anomalies.
Types of Normal Forms
- First Normal Form (1NF)
- Each field contains atomic (indivisible) values.
- No repeating groups.
- Second Normal Form (2NF)
- Table must be in 1NF.
- All non-key attributes must depend on the entire primary key.
- Third Normal Form (3NF)
- Table must be in 2NF.
- No transitive dependency (non-key attributes depend only on the primary key).
ACID Properties
ACID ensures reliable database transactions:
- Atomicity – Transaction happens completely or not at all.
- Consistency – Database remains valid before and after transaction.
- Isolation – Transactions do not interfere with each other.
- Durability – Changes remain even after system failure.
Three-Tier Architecture
The Three-Tier Architecture divides an application into three layers:
- Presentation Layer – User interface (client).
- Application Layer – Business logic and processing.
- Data Layer – Database server.
Advantages:
- Better security
- Easy maintenance
- Scalability
DBMS Languages
DBMS languages are used to define, manipulate, and control databases.
Types:
- DDL (Data Definition Language) – CREATE, ALTER, DROP
- DML (Data Manipulation Language) – INSERT, UPDATE, DELETE
- DCL (Data Control Language) – GRANT, REVOKE
- TCL (Transaction Control Language) – COMMIT, ROLLBACK
Concurrency Control
Two-Phase Locking is a concurrency control method used to maintain database consistency.
Two phases:
- Growing Phase – Locks are acquired.
- Shrinking Phase – Locks are released.
Concurrency control manages simultaneous execution of transactions to avoid conflicts. Methods:
- Locking
- Timestamp ordering
- Optimistic concurrency control
| Feature | DBMS | File System |
|---|---|---|
| Redundancy | Reduces redundancy | High redundancy |
| Security | Better security | Less security |
| Concurrency | Supports concurrency | Limited concurrency |
| Integrity | Data integrity maintained | Integrity difficult |
Data Abstraction
Data abstraction is the process of hiding complex database details from the users and showing only the necessary information.
Levels of Data Abstraction:
- Physical Level – Describes how data is actually stored (files, indexes, storage details).
- Logical Level – Describes what data is stored and the relationships among the data.
- View Level – The highest level, which shows only a part of the database to the user according to their needs.
The Database Administrator (DBA)
A Database Administrator (DBA) is responsible for managing, maintaining, and controlling the database system to ensure its efficient operation.
Main Functions of a DBA
- Database Design: The DBA designs the structure of the database, including tables, relationships, and constraints.
- Installation and Configuration: The DBA installs the DBMS software and configures it for proper functioning.
- Security Management: The DBA controls user access and permissions to protect the database.
- Backup and Recovery: The DBA regularly backs up the database and restores it in case of failure.
- Performance Monitoring: The DBA monitors performance and optimizes queries and storage.
- Data Integrity: The DBA ensures that the data remains accurate and consistent.
- Concurrency Control: The DBA manages simultaneous access to avoid conflicts.
- Database Maintenance: Regular updates, patches, and troubleshooting are handled by the DBA.
