CampusFlow
DatabaseDatabase Basics

📚 Database Basics

Learn fundamental database concepts, DBMS architecture, and data models.

DBMS

Software that manages databases — stores, retrieves, and processes data efficiently.

Schema

The logical structure of a database — defines tables, columns, relationships, and constraints.

Data Models

How data is structured: Relational, Document, Key-Value, Graph, and Column-Family.

DDL vs DML

DDL defines structure (CREATE, ALTER). DML manipulates data (SELECT, INSERT, UPDATE, DELETE).

Three-Schema Architecture

External LevelUser View

How individual users view the data. Multiple views for different users.

e.g., A student sees only their grades, not all grades.

Conceptual LevelLogical

The community view — entire logical structure of the database.

e.g., All tables, relationships, constraints defined.

Internal LevelPhysical

Physical storage details — how data is stored on disk.

e.g., File organization, indexes, data compression.

Types of DBMS

Relational (RDBMS)

Data in tables with rows/columns. Uses SQL. Examples: MySQL, PostgreSQL, Oracle.

Most Popular

NoSQL Document

Data stored as JSON-like documents. Examples: MongoDB, CouchDB.

Flexible Schema

NoSQL Key-Value

Simple key-value pairs. Fast lookups. Examples: Redis, DynamoDB.

High Performance

NoSQL Graph

Nodes & edges for connected data. Examples: Neo4j, ArangoDB.

Relationships

Column-Family

Data in column families. Examples: Cassandra, HBase.

Big Data

Advantages of DBMS

Controls data redundancy (minimizes duplication)
Ensures data consistency across the system
Enforces data integrity constraints
Provides concurrent access with ACID transactions
Offers data security with authentication/authorization
Enables data independence (logical & physical)
Supports backup and recovery mechanisms
Reduces application development time

Interview Questions

Q1: What is a database management system (DBMS)?

A: A DBMS is software that enables users to define, create, maintain, and control access to databases. It acts as an intermediary between users and data.

Q2: What is the difference between DBMS and RDBMS?

A: DBMS stores data as files, while RDBMS stores data in tables with relationships. RDBMS supports ACID transactions, normalization, and uses SQL.

Q3: Explain the three levels of data abstraction.

A: External (user views), Conceptual (logical structure), Internal (physical storage). This provides data independence.

Q4: What is data independence?

A: The ability to change the schema at one level without affecting the next level. Logical independence: changing conceptual schema without affecting external views. Physical independence: changing storage without affecting conceptual schema.

Q5: What are the advantages of using a DBMS?

A: Data redundancy control, data consistency, data sharing, security enforcement, backup/recovery, concurrent access management, and data independence.