📚 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
How individual users view the data. Multiple views for different users.
e.g., A student sees only their grades, not all grades.
The community view — entire logical structure of the database.
e.g., All tables, relationships, constraints defined.
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 PopularNoSQL Document
Data stored as JSON-like documents. Examples: MongoDB, CouchDB.
Flexible SchemaNoSQL Key-Value
Simple key-value pairs. Fast lookups. Examples: Redis, DynamoDB.
High PerformanceNoSQL Graph
Nodes & edges for connected data. Examples: Neo4j, ArangoDB.
RelationshipsColumn-Family
Data in column families. Examples: Cassandra, HBase.
Big DataAdvantages of DBMS
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.