1
Part I: Part I — Foundations
5 chapters- Part I — Foundations
- Chapter 1: What Is a Database? Why Spreadsheets Break and Databases Don't
- Chapter 2: Setting Up PostgreSQL, Your First Database, and the Tools You'll Use
- Chapter 3: The Relational Model — Tables, Rows, Columns, Keys, and the Mathematical Foundation of SQL
- Chapter 4: Relational Algebra — The Operations Underneath Every SQL Query
2
Part II: Part II — SQL Mastery
13 chapters- Part II — SQL Mastery
- Chapter 5: SELECT, FROM, WHERE — Your First Queries
- Chapter 6: JOINs — Connecting Tables, the Most Important SQL Skill
- Chapter 7: Aggregation — GROUP BY, HAVING, and Summarizing Data
- Chapter 8: Built-in Functions — Strings, Numbers, Dates, and Type Conversion
- Chapter 9: Subqueries — Queries Inside Queries
- Chapter 10: Set Operations — UNION, INTERSECT, EXCEPT
- Chapter 11: Common Table Expressions and Recursive Queries
- Chapter 12: Window Functions — Analytics Without Losing Row Detail
- Chapter 13: Data Modification — INSERT, UPDATE, DELETE, and UPSERT
- Chapter 14: Data Definition — CREATE, ALTER, DROP, and Building Your Schema
- Chapter 15: Views, Materialized Views, and Functions — Reusable SQL Objects
- Chapter 16: Advanced SQL — JSON, Full-Text Search, Arrays, and PostgreSQL Superpowers
3
Part III: Part III — Database Design
7 chapters- Part III — Database Design
- Chapter 17: Entity-Relationship Modeling — Drawing the Blueprint Before Building
- Chapter 18: From ER Diagram to Tables — Translating Your Design into DDL
- Chapter 19: Normalization — Eliminating Redundancy and Protecting Data Integrity
- Chapter 20: Denormalization — When Breaking the Rules Is the Right Decision
- Chapter 21: Data Modeling Patterns — Solving Common Design Problems
- Chapter 22: Schema Migration and Evolution — Changing Your Database Without Breaking Everything
4
Part IV: Part IV — Performance and Internals
7 chapters- Part IV — Performance and Internals
- Chapter 23: Indexing — The Data Structure That Makes Databases Fast
- Chapter 24: Query Optimization — Reading EXPLAIN Plans and Making Queries Fast
- Chapter 25: Table Partitioning — Scaling a Table Beyond a Single Heap
- Chapter 26: Transaction Management — ACID Properties and Keeping Data Consistent
- Chapter 27: Concurrency Control — What Happens When Two Users Touch the Same Data
- Chapter 28: Database Internals — How PostgreSQL Stores and Retrieves Your Data
5
Part V: Part V — Application Integration
5 chapters- Part V — Application Integration
- Chapter 29: Connecting Applications to Databases — Python, psycopg2, and Access Patterns
- Chapter 30: ORMs — SQLAlchemy, Object-Relational Mapping, and When Abstraction Helps vs. Hides
- Chapter 31: Bulk Data Operations and ETL Foundations — COPY, Loading, and Moving Data at Scale
- Chapter 32: Database Security — SQL Injection, Access Control, Encryption, and Protecting Your Data
6
Part VI: Part VI — Beyond Relational
6 chapters- Part VI — Beyond Relational
- Chapter 33: NoSQL — Document, Key-Value, Column-Family, and Graph
- Chapter 34: Data Warehousing — Star Schemas, Dimensional Modeling, and Databases for Analytics
- Chapter 35: Distributed Databases — Replication, Sharding, and the CAP Theorem
- Chapter 36: Time-Series, Vector, and Specialized Databases — The Right Tool for the Right Data
- Chapter 37: The Database Decision — How to Choose the Right Database for Your Application
7
Part VII: Part VII — Administration and Career
4 chapters8
Appendices
14 chapters- Appendix A — PostgreSQL Setup Guide
- Appendix B — The Mercado Practice Database
- Appendix C — SQL Quick Reference
- Appendix D — PostgreSQL Data Types Reference
- Appendix E — Relational Algebra Reference
- Appendix F — Normalization Reference
- Appendix G — EXPLAIN and Tuning Reference
- Appendix H — psql and Tooling Reference
- Appendix I — SQL Cookbook
- Appendix J — SQL Dialect Differences
- Answers to Selected Exercises
- Glossary
- Bibliography & Resources
- Index
Explore Related Books
More open-access textbooks from our library
Advanced COBOL 40 chapters · ~67h Advanced Data Science 39 chapters · ~57h AI Ethics 39 chapters · ~82h AI Literacy 21 chapters · ~13h AI & ML for Business 40 chapters · ~80h AI Engineering 40 chapters · ~53h Algorithmic Addiction 40 chapters · ~71h American Government 40 chapters · ~77h Applied Psychology 40 chapters · ~52h Assembly Language 40 chapters · ~27h Blockchain & Crypto 40 chapters · ~68h Calculus 40 chapters · ~51h Automotive Sales 40 chapters · ~73h College Football Analytics 28 chapters · ~18h Creator Economy 41 chapters · ~57h Pattern Recognition 43 chapters · ~92h Cybersecurity 40 chapters · ~84h Data & Society 40 chapters · ~71h Data Viz with Python 35 chapters · ~53h Discrete Mathematics for Computer Science 40 chapters · ~75h Ethical Hacking 41 chapters · ~58h Fandom 44 chapters · ~71h Forensic Science 40 chapters · ~74h Grant Writing 35 chapters · ~36h History of Appalachia 42 chapters · ~69h How Humans Get Stuck 40 chapters · ~36h Handling Confrontation 40 chapters · ~80h How to Learn Anything 38 chapters · ~54h How Your House Works 40 chapters · ~66h IBM DB2 37 chapters · ~53h Insurance Underwriting 40 chapters · ~71h Intermediate COBOL 54 chapters · ~44h Intermediate Data Science 36 chapters · ~39h Intro CS Python 27 chapters · ~13h Intro to Data Science 36 chapters · ~54h Introductory Economics 40 chapters · ~12h Introductory Statistics 28 chapters · ~47h Learning COBOL 42 chapters · ~64h Prediction Markets 42 chapters · ~60h Linear Algebra 40 chapters · ~60h Metacognition 28 chapters · ~52h Media Literacy 41 chapters · ~81h Music Production 40 chapters · ~84h NFL Analytics 28 chapters · ~16h Nuclear Physics 35 chapters · ~28h Organic Chemistry 40 chapters · ~21h Pascal Programming 40 chapters · ~43h Photography 40 chapters · ~85h Physics of Music 48 chapters · ~75h Political Analytics 41 chapters · ~67h Popular Psychology 40 chapters · ~21h Practical Philosophy 38 chapters · ~63h Basketball Analytics 31 chapters · ~30h Soccer Analytics 30 chapters · ~43h Propaganda 40 chapters · ~80h Python for Business 40 chapters · ~40h Quantum Mechanics 40 chapters · ~66h RegTech 40 chapters · ~59h The Science of Cooking 40 chapters · ~70h Science of Seduction 45 chapters · ~60h Sports Betting 42 chapters · ~63h Technical Writing 40 chapters · ~70h Architecture of Surveillance 40 chapters · ~54h Science of Luck 40 chapters · ~72h Eastern Cultures 40 chapters · ~47h Western Culture 40 chapters · ~30h Vibe Coding 42 chapters · ~58h Video Game Design 40 chapters · ~36h Why They Watch 40 chapters · ~48h Working with AI 42 chapters · ~58h