• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 7 páginas
Resumen

Summary SQL & Relational Database Management Complete Study Guide - Normalization, B+ Trees, ACID, Window Functions - CS 186 / CS 340 Exam Cheat Sheet

Document preview thumbnail
Vista previa 2 fuera de 7 páginas

COMPREHENSIVE SQL & RELATIONAL DATABASE MANAGEMENT STUDY GUIDE & EXAM CHEAT SHEET Preparing for your database midterm or final exam? This high-yield, professionally formatted study companion covers core relational database theory, query execution, indexing, and transaction protocols without fluff. WHAT'S INCLUDED IN THIS COMPLETE GUIDE: Master SQL Operations & Relational Algebra Matrix: Mapping between SELECT/JOIN/WHERE and algebraic projection/selection/cross-products. True SQL Logical Execution Order: Why SELECT executes after WHERE and GROUP BY, and how it impacts aliases. Functional Dependencies & Normalization: Step-by-step algorithms for 1NF, 2NF, 3NF, and BCNF lossless/dependency-preserving decompositions. Storage & B+ Tree Indexing: Clustered vs. secondary index differences, composite index Leftmost Prefix Rule, and fan-out cost models. Transactions & ACID Guarantees: Detailed breakdown of Dirty Reads, Non-Repeatable Reads, and Phantom Reads across all 4 SQL Isolation Levels. Concurrency Control Protocols: Two-Phase Locking (2PL), Strict 2PL, Cascading Abort prevention, and Deadlock detection. Advanced SQL Window Functions: ROW_NUMBER(), RANK(), DENSE_RANK(), LAG(), LEAD(), and moving averages. 10 Deadly Exam Traps: Three-valued NULL logic, NOT IN with NULL failure, and WAL invariants. 20 Rapid-Fire Flashcards: Active recall Q&A prompts for pre-exam self-assessment. PERFECT FOR: - Students enrolled in CS 186, CS 340, DATA 100, or Information Systems - Midterm & Final Exam cramming - Technical interview preparation for Data Engineering & Backend roles ️ LEGAL DISCLAIMER: This is an independent academic summary and study aid. It is not affiliated with, endorsed by, or sponsored by any specific university, textbook author, or publisher.

Vista previa del contenido

HIGH-YIELD REVISION GUIDE & CHEAT SHEET


SQL & Relational Database Systems
Complete Semester Guide
High-Yield Comprehensive Guide, Relational Algebra, B+ Tree Mechanics,
Normalization Decompositions, ARIES Recovery & Quick-Cram Appendix


Computer Science & Data Engineering | Course Code: CS 186 / CS 340 / DATA 100 | 2024-2025
Comprehensive Edition




📘 WHAT’S INSIDE THIS GUIDE:
✔ Relational Algebra & True SQL Execution Order with query cost optimization models


✔ Database Normalization Theory: Functional dependency closures, candidate keys, and step-
by-step 3NF/BCNF decompositions

✔ B+ Tree Indexing Deep Dive: Step-by-step worked trace of node splits, redistribution, and
height calculations

✔ Query Evaluation & Join Algorithms: Detailed disk I/O cost formulas for Page/Block Nested
Loop, Index Nested Loop, and Grace Hash Join

✔ Concurrency Control & Strict 2PL: Conflict serializability, Precedence Graphs, and 4 ANSI
Isolation Levels

✔ Crash Recovery (ARIES): Write-Ahead Logging (WAL) protocol and Analysis, Redo, and Undo
phase traces

✔ 10 Deadly Database Exam Traps covering NULL three-valued logic, subquery pitfalls, and
index scans

✔ APPENDIX: 1-Hour Emergency Pre-Exam Quick-Cram Cheat Sheet with master relational
matrix and 25 active recall flashcards
Disclaimer: This is an independently created academic study aid. It is not affiliated with, endorsed by, or sponsored by any specific
university, textbook author, or publisher.

, Computer Science & Data Engineering · CS 186 / CSSQL & Relational Database Systems Complete Semester
340 / DATA 100 Guide




1 Relational Algebra & Query Execution Mechanics
Relational algebra provides the formal foundation for declarative SQL query optimization.


1.1 Core Relational Operators
• Selection (𝜎𝑐(𝑅) ): Filters tuples satisfying predicate 𝑐.
• Projection (𝜋𝐿(𝑅) ): Extracts specified attributes 𝐿, deduplicating duplicate rows in pure relational
theory.
• Natural Join (𝑅 ⨝ 𝑆): Equi-join over all shared attributes, projecting out duplicate column names.
• Theta Join (𝑅 ⨝𝜃 𝑆): Cross-product followed by selection: 𝜎𝜃(𝑅×𝑆) .


1.2 The True SQL Logical Execution Pipeline
Unlike procedural languages, SQL executes declaratively in this strict logical sequence:
1. FROM / JOIN: Evaluates Cartesian products and evaluates ON filters to build the virtual table.
2. WHERE: Filters individual candidate rows before aggregation.
3. GROUP BY: Partitions remaining rows into aggregate groups.
4. HAVING: Filters aggregated groups based on summary predicates (e.g., COUNT(*) > 2).
5. SELECT: Evaluates projection list, mathematical expressions, and window functions.
6. DISTINCT: Eliminates duplicate rows from the projected set.
7. ORDER BY: Sorts the final result set using the specified collation.
8. LIMIT / OFFSET: Truncates output tuples for client delivery.


2 Functional Dependencies & Normalization Step-by-Step

2.1 WORKED STEP-BY-STEP PROBLEM: Candidate Keys & BCNF Decompo-
sition
Problem: Consider relation 𝑅(𝐴, 𝐵, 𝐶, 𝐷, 𝐸) with Functional Dependencies (FDs):
𝐹 = {𝐴𝐵 → 𝐶, 𝐶 → 𝐷, 𝐷 → 𝐸, 𝐸 → 𝐴}

Find all Candidate Keys of 𝑅, test whether 𝑅 is in 3NF or BCNF, and decompose into BCNF if violated.

2.1.1 Step 1: Attribute Closures & Candidate Key Derivation
• Calculate closure of (𝐴𝐵)+ :
‣ (𝐴𝐵)+ = {𝐴, 𝐵}
‣ Using 𝐴𝐵 → 𝐶: adds 𝐶 → {𝐴, 𝐵, 𝐶}
‣ Using 𝐶 → 𝐷: adds 𝐷 → {𝐴, 𝐵, 𝐶, 𝐷}
‣ Using 𝐷 → 𝐸: adds 𝐸 → {𝐴, 𝐵, 𝐶, 𝐷, 𝐸} = 𝑅.
‣ Therefore, 𝐴𝐵 is a Candidate Key!
• Since 𝐸 → 𝐴, substitute 𝐴 with 𝐸: (𝐸𝐵)+ = {𝐴, 𝐵, 𝐶, 𝐷, 𝐸} = 𝑅 → 𝐸𝐵 is a Candidate Key.
• Since 𝐷 → 𝐸, substitute 𝐸 with 𝐷: (𝐷𝐵)+ = 𝑅 → 𝐷𝐵 is a Candidate Key.
• Since 𝐶 → 𝐷, substitute 𝐷 with 𝐶: (𝐶𝐵)+ = 𝑅 → 𝐶𝐵 is a Candidate Key.
• Prime Attributes (members of any candidate key): {𝐴, 𝐵, 𝐶, 𝐷, 𝐸}. All attributes are prime!




Independent Study Aid. Not affiliated with or endorsed by any specific university or Page 2 of 7
publisher.

Información del documento

Subido en
24 de octubre de 2026
Número de páginas
7
Escrito en
2026/2027
Tipo
Resumen
$15.98

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
0
Artículos
15
Última venta
-



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes