Relational Databases
From what data even means to production-scale internals — one continuous story, not a fresh toy example every chapter.
7
Acts
43
Chapters
GreenMart
The Story
The Index
7 Acts. 43 Chapters. One continuous story.
From Notebook to Database
Mike's notebook keeps failing. Sarah builds GreenMart's first real database.
What Is Data?
The Notebook Problem
What Is a Database?
Giving Data a Home
Entities and Attributes
"Who Even Are My Customers?"
Primary Keys
Two Customers Named Alex, One Register
Foreign Keys & Referential Integrity
Tabs for Customers Who Don't Exist
Constraints (NOT NULL, UNIQUE, CHECK, DEFAULT)
Rules the Store Never Breaks
Data Types
What Kind of Box Does This Go In
ER Diagrams
Drawing the Shop on Paper
Design GreenMart's First Schema
Learning to Talk to It
The database exists now — Sarah has to actually make it useful, one real request at a time.
DDL: CREATE, ALTER, DROP
Building the Shop, Table by Table
DML: INSERT, UPDATE, DELETE
Putting Data In, Taking Data Out
SELECT, WHERE, ORDER BY
"How Much Did We Sell Today?"
NULL & Three-Valued Logic
The Value That Isn't There
Aggregate Functions
Mike Wants Answers, Not Rows
SQL Execution Order
The Language Has Rules Too
Answer Mike's Real Questions
Going Online
GreenMart launches a website — orders, delivery, and online customers all need to connect.
Schema Evolution
GreenMart Gets a Website
SQL Joins
Which Customer Ordered What
GROUP BY & Window Functions
Our Best (and Worst) Sellers
Subqueries & CTEs
Digging Deeper Without Repeating Yourself
SQL Views
Mike's Daily Report, Automated
Build GreenMart's First Dashboard
Growing Pains
Real bugs, at real scale. Every concept in this Act exists to stop something that already broke.
Concurrency Problems
The Flash Sale That Broke Everything
Race Conditions & Locking
Two Staff, One Last Item
Transactions & ACID
The Order That Half-Happened
Isolation Levels
Promises a Database Keeps
Normalization
GreenMart's Original Schema Starts Creaking
Fix GreenMart's Race Condition
The Slow Query
GreenMart has millions of orders now. The query that used to be instant isn't anymore.
Why Queries Get Slow
"It Used to Be Instant"
Indexes & B-Trees
How the Database Actually Finds a Row
Index Types & Selectivity
Not Every Index Is the Same
Query Execution Plans
What Happens When You Hit Run
Query Optimization
Teaching the Optimizer
Storage Engine Internals
Underneath It All
Make GreenMart's Slowest Query Fast
Running a Real Database
GreenMart is a real, multi-city business now — and it needs to act like one.
Database Security & Permissions
Who's Allowed to See What
Backup & Recovery
The Day the Server Died
Scaling Databases
One City Becomes Ten
Schema Migrations
Changing the Schema Without Breaking the Store
Choosing a Database Engine
Which One Would GreenMart Actually Run?
Design GreenMart's Scaling Plan
The Capstone
GreenMart's own journey, seen next to the systems that inspired it.
The Acquisition
Course Complete