Introduction to Databases

What Is Data?

Any information that can be stored is called data.

We use data every day in different applications and systems.

Examples of Data

  1. Messages, photos, and videos on WhatsApp
  2. Products, customers, and orders on Amazon
  3. Contact details stored in a phone directory
  4. Student records in schools and colleges
  5. Banking transactions in banking systems

What Is a Database?

A database is an organized collection of data.

Instead of storing information randomly, databases arrange the data properly so it can be:

  • Stored efficiently
  • Accessed quickly
  • Updated easily
  • Managed securely

Real-World Example

Imagine a school storing:

  • Student details
  • Teacher information
  • Exam marks
  • Attendance records

If everything is stored in notebooks, searching becomes difficult.

A database stores all this information in an organized manner.

What Is DBMS?

DBMS (Database Management System)

A DBMS is software used to store, manage, retrieve, and secure data inside a database.

It acts as a bridge between users/applications and the database.

Simple DBMS Architecture

Introduction to Databases

How DBMS Works

Introduction to Databases

Advantages of DBMS

1. Security

DBMS keeps data secure and prevents unauthorized access.

Example

Only bank employees can access customer account details.

2. Ease of Use

DBMS makes it easy to:

  • Insert data
  • Update data
  • Delete data
  • Search data

3. Durability and Availability

Data remains safe even after system failures and is available whenever needed.

Example

ATM systems work 24/7 because databases are continuously available.

4. Performance

DBMS provides fast access to data even when millions of records are stored.

Example

Searching a product on Amazon takes only a few seconds.

Types of Databases

Databases are classified based on how data is stored and organized.

Introduction to Databases

Databases

├── Relational Database

└── Non-Relational Database
├── Key-Value
├── Document
├── Column Family
└── Graph

Relational Database

In a Relational Database, data is stored in the form of tables.

Each table contains:

  • Rows → Records
  • Columns → Fields

Example of Relational Database Table

Student Table

student_id

student_name

course

1

Rahul

SQL

2

Priya

Python

3

Amit

Spark

Features of Relational Databases

  • Data stored in tables
  • Easy to understand
  • Supports relationships between tables
  • Uses SQL language

Examples of Relational DBMS

  • Oracle Database
  • PostgreSQL
  • MySQL
  • SQLite
  • Microsoft SQL Server
  • IBM Db2

Non-Relational Database (NoSQL)

Non-relational databases store data in non-tabular formats.

They are commonly used for:

  • Big data
  • Real-time applications
  • Flexible and rapidly changing data

Types of Non-Relational Databases

1. Key-Value Database

Data is stored as:

Key -> Value

Example

101 -> Rahul
102 -> Priya

Example DBMS

  • Redis
  • Amazon DynamoDB

2. Document Database

Stores data in JSON-like documents.

Example

{
"name": "Rahul",
"course": "SQL"
}

Example DBMS

  • MongoDB
  • CouchDB

3. Column Family Database

Stores data in columns instead of rows.

Used for handling huge amounts of data.

Example DBMS

  • Apache Cassandra

4. Graph Database

Stores data in the form of nodes and relationships.

Used in:

  • Social networks
  • Recommendation systems
  • Fraud detection

Example DBMS

  • Neo4j

Relational vs Non-Relational Database

Feature

Relational Database

Non-Relational Database

Structure

Tables

Flexible formats

Schema

Fixed

Dynamic

Language

SQL

Different APIs/queries

Best For

Structured data

Unstructured/semi-structured data

Scalability

Vertical scaling

Horizontal scaling

Important Notes

  • Choice of database depends on project requirements.
  • Relational databases are the most commonly used databases.
  • Non-relational databases are popular in big data and modern web applications.

Summary

Topic

Description

Data

Raw information

Database

Organized collection of data

DBMS

Software to manage databases

Relational Database

Data stored in tables

Non-Relational Database

Data stored in flexible formats

RDBMS

DBMS for relational databases

VT
Written byVishal Taneja
Knowledge Check

Test Your Understanding

Take this interactive quiz to reinforce what you've learned. Earn badges, track your streak, and master the concepts!

  • 5-10 questions per quiz
  • Earn achievement badges
  • Build answer streaks
  • Track your speed