Dulranga's Notes
Semester 3Database Systems

Roadmap

**1.Master Relational Model Foundations:**Phase 1: Database Primitives.

Build a firm grasp on foundational terminology:

  • Relations & Tuples: Tables, rows (tuples), and attributes (columns).

  • Keys: Understand Primary Keys, Candidate Keys, Super Keys, and Foreign Keys.

  • Integrity Rules: Entity integrity (non-null primary keys) and referential integrity.

**2.Learn Relational Algebra Operators:**Phase 2: Formal Querying.

Learn how procedural operators manipulate relations to produce new relations:

  • Fundamental Operators: Selection (σ\sigma), Projection (π\pi), Rename (ρ\rho), Union (∪\cup), Set Difference (−-), Cartesian Product (×\times).

  • Derived Operators: Natural Join (⋈\bowtie), Theta Join (⋈θ\bowtie_{\theta}), Division (÷\div), and Outer Joins.

**3.Understand Functional Dependencies (FDs):**Phase 3: Attribute Relationships.

Analyze how data attributes relate to one another within a table:

  • FD Syntax: Express constraints as X→YX \rightarrow Y (XX functionally determines YY).

  • Attribute Closure: Calculate X+X^+ to find all attributes determined by set XX.

  • Key Identification: Determine minimal candidate keys using closure sets.

**4.Work Through Normal Forms:**Phase 4: Schema Decomposition.

Systematically eliminate data redundancy through schema decomposition:

  • 1NF1\text{NF}: Ensure all column values are atomic (no arrays or repeating groups).

  • 2NF2\text{NF}: Be in 1NF1\text{NF} and remove partial dependencies (non-prime attributes depending on part of a composite key).

  • 3NF3\text{NF}: Be in 2NF2\text{NF} and remove transitive dependencies (A→B→CA \rightarrow B \rightarrow C).

  • BCNF: Strict 3NF3\text{NF} variant where every determinant XX in X→YX \rightarrow Y must be a super key.

**5.Connect Theory to SQL & Optimization:**Phase 5: Practical Application.

Bridge theoretical concepts to real-world SQL engines:

  • Map algebraic operations directly to SELECT, WHERE, JOIN, and HAVING clauses.

  • Understand how database query planners convert raw SQL into relational algebra execution trees.