Purpose of Database

A database is designed to store large amounts of data in an organized, structured, and efficient manner. The main purpose of a database is to manage data so that it can be easily accessed, updated, shared, and protected.

1. Why is a Database Needed?

In modern applications, data plays a crucial role. Storing data in simple files creates many problems. Databases are needed to overcome these limitations.

2. Main Purposes of a Database

3. File System vs Database

Databases were introduced to solve the problems of traditional file systems.

Traditional File System          Database System
------------------------         -------------------------
Data redundancy                  Minimal redundancy
Poor data security               High data security
Difficult data access            Easy and fast access
No concurrency control           Supports multi-user access
Manual backup                    Automatic backup & recovery

4. Reduction of Data Redundancy

Data redundancy means duplication of data at multiple locations. A database stores data at a single place and shares it across applications.

Without Database:
Student File → Name, Course
Fees File    → Name, Course

With Database:
STUDENT TABLE
Name | Course | Fees

5. Maintaining Data Consistency

Consistency means that data remains correct and up-to-date across the entire system. When redundancy is reduced, consistency automatically improves.

6. Data Sharing

A database allows multiple users to access the same data simultaneously without conflicts.

User A ─┐
        ├── DATABASE ─── Shared Data
User B ─┘

7. Data Security

Databases provide security mechanisms to protect data from unauthorized access.

8. Backup and Recovery

Databases support automatic backup and recovery to protect data from system failure, crashes, or power loss.

9. Real-Life Uses of Database

Practice Questions

  1. What is the purpose of a database?
  2. Why databases are preferred over file systems?
  3. Explain data redundancy.
  4. How does a database ensure data security?
  5. Explain backup and recovery.

Practice Task

Write short notes on: ✔ Purpose of Database ✔ File System vs Database ✔ Data Redundancy & Consistency ✔ Data Sharing & Security ✔ Backup and Recovery