📑 Chapters

📚 DBMS Unit 1

Database Fundamentals • Data Models • Relational Algebra & Calculus

Compiled & Formatted by Ankush Raj

📘 Chapter 1.1 — Overview of Databases
1. Data & Information
Data – Definition

Raw facts, figures, symbols with no meaning.

Information – Definition

Processed and meaningful form of data.

2. Database
Definition: A structured collection of interrelated data stored in an organized manner so that it can be easily accessed, updated, and managed.
3. DBMS (Database Management System)
Definition: Software used to define, store, manage, retrieve, and control access to the database.
Functions of DBMS
• Data storage & retrieval
• Data security
• Concurrency control
• Backup & recovery
• Data integrity
• Minimizing redundancy
4. Database System Architecture (ANSI-SPARC 3-Level)
Definition: 3-level architecture separates user view from physical storage to achieve data independence.
1. External Level (View Level)
• User-specific customized views
• Provides security
• Each user sees only required data
2. Conceptual Level (Logical Level)
• Represents entire database structure
• Tables, relationships, constraints
• DBA works here
3. Internal Level (Physical Level)
• How data is physically stored
• Indexing, file structure, storage methods
5. Data Independence
Definition: Ability to modify schema at one level without affecting next higher level.

Types: Logical Data Independence, Physical Data Independence

6. Advantages of DBMS
• Reduced redundancy
• Improved data security
• Increased data consistency
• Data sharing
• Backup & recovery
• Integrity enforcement
7. Disadvantages of DBMS
• High cost
• Complex to use
• Requires powerful hardware
• Failure stops entire system
8. DBA (Database Administrator)
Definition: Person responsible for overall management of the database.
Responsibilities
• Designing database
• Managing user accounts
• Backup & recovery
• Monitoring security
• Performance tuning
• Enforcing integrity rules
9. Relational Data Structure
Definition: Data stored in tables (relations) consisting of rows (tuples) and columns (attributes).
10. Keys in Relational Model
Super Key: Set of attributes that uniquely identifies a tuple

Candidate Key: Minimal super key

Primary Key: Chosen candidate key; cannot be NULL

Alternate Key: Remaining candidate keys

Foreign Key: Attribute referencing another table's primary key

Composite Key: Key consisting of multiple attributes
11. Schema & Instance

Schema – Definition: Blueprint of the database (structure)

Instance – Definition: Actual data stored at a particular moment

12. Entity Integrity
Definition: Primary key cannot be NULL.
13. Referential Integrity
Definition: Foreign key must refer to an existing primary key.
📘 Chapter 1.2 — Data Models & ER Model
1. Data Model
Definition: Represents how data is structured, stored, and related within a database.
Types of Data Models
1. Relational Model
Definition: Data stored in tables (relations) using rows and columns
Features: Simple structure, Uses keys, Modern DBMS
2. Hierarchical Model
Definition: Data stored in tree-like structure (parent-child)
Characteristics: One parent/many children, Fast access, Not for complex relations
3. Network Model
Definition: Data stored in graph structure with many-to-many relationships
2. ER Model (Entity-Relationship)
Definition: Used for designing database logically using entities, attributes, and relationships.
Components

Entity: Real-world object (Student, Teacher)

Attribute: Characteristic of entity (Roll, Name)

Relationship: Association between entities (Teacher teaches Student)

Types of Attributes
• Simple
• Composite
• Single-valued
• Multi-valued
• Derived
Mapping Constraints
• Cardinality (1:1, 1:N, M:N)
• Participation (Total/Partial)
Model Comparison
Model Structure Relationship
Relational Table All types
Hierarchical Tree 1:N
Network Graph M:N
📘 Chapter 1.3 — Relational Algebra & Calculus
Relational Algebra
Definition: Procedural query language that tells how to retrieve data from relations.
Basic Operators

1. Selection (σ) - Selects rows

2. Projection (π) - Selects columns

3. Union (∪) - Combines two relations

4. Set Difference (–) - Returns tuples in one but not other

5. Cartesian Product (×) - Combines attributes of two relations

6. Rename (ρ) - Renames relation/attributes

Additional Operators
• Natural Join, Theta Join, Equi Join, Outer Join, Division
• Grouping (γ) - SUM, AVG, MAX, MIN, COUNT
Relational Calculus
Definition: Non-procedural query language that tells what data to retrieve.
1. Tuple Relational Calculus (TRC)
Uses tuple variables to represent rows
Example: { t | t ∈ Student AND t.age > 18 }
2. Domain Relational Calculus (DRC)
Uses domain variables to represent columns
Example: { <n, a> | ∃s (s ∈ Student AND s.name=n) }
Relational Algebra vs Calculus
Basis Algebra Calculus
Type Procedural Non-procedural
Focus How data fetched What data needed
Basis SQL Engine SQL Theory
Computational Capabilities
Codd's Theorem: Relational Algebra and Relational Calculus are equally powerful. Anything expressible in RA can be expressed in RC.