SQL & Databases — The Layer Under Everything
You just finished a whole Spring Boot track — built a real API, secured it, tested it — and you never once spoke to the database directly. Hibernate spoke for you. Every friend you POSTed, every expense you saved, ended up as rows in PostgreSQL that you have never actually looked at. This track fixes that, because SQL is the one skill in your stack with no expiry date: it predates Java by two decades, it outlived every framework that promised to hide it, and it will outlive whatever replaces Spring.
Frameworks are fashion. SQL is plumbing. Plumbers always have work.
Why Now
Because splitease-api exists. You have a running Spring Boot app whose data lives in PostgreSQL, and right now that database is a black box you talk to through an interpreter. In Spring Boot 04 you watched Hibernate print its SQL and learned to count queries — but you read that SQL the way you’d read a language you don’t speak: you recognized the shape, not the meaning.
This track opens the hood. Same data, same tables — but no Hibernate in between. You in psql, typing the SQL yourself, reading the errors yourself, watching the query plans yourself. By the end, spring.jpa.show-sql output isn’t noise you scroll past; it’s a junior colleague’s work that you review and sometimes reject.
This is also the textbook under week 5 — the database mastery week of the sprint.
The Database Outlives The App
Here’s the argument that justifies eight modules of effort.
| Application code | The schema and its data | |
|---|---|---|
| Typical lifetime | 2–4 years before a rewrite | 10+ years, survives every rewrite |
| Who depends on it | One app | Every app, script, report, and intern that ever touches the data |
| Cost of a mistake | Fix it, redeploy, done in a day | Migrate millions of live rows without downtime — weeks, if you’re lucky |
Companies rewrite their backend from Java to Go, from monolith to microservices — and the PostgreSQL schema underneath barely flinches. The data is the business; the code is just this year’s way of touching it. Which means schema mistakes are the expensive ones: a money column declared as FLOAT, a missing foreign key, a table with no clear identity — these don’t get “fixed in the next sprint.” They get worked around for a decade, or migrated at enormous cost.
The engineer who designs schemas well is making the longest-lived decisions in the company. That’s the skill this track builds.
The Journey
flowchart LR
A["01 Tables and Keys"] --> B["02 Reading"]
B --> C["03 Joins"]
C --> D["04 Aggregation"]
D --> E["05 Modeling"]
E --> F["06 Indexes"]
F --> G["07 Transactions"]
G --> H["08 Capstone"]
First you learn what a table is and what the database guarantees about it. Then reading data, combining tables, summarizing them. Module 05 is the turn: you stop consuming schemas and start designing them. Then the two topics that separate juniors from engineers — why queries are slow (indexes) and why concurrent money math doesn’t corrupt (transactions). The capstone turns all of it loose on your own SplitEase data.
Setup — Ten Minutes, Once
1. PostgreSQL. If you took Path A in Spring Boot 04, it’s already installed — skip ahead. If not: install from postgresql.org, remember the password you set for the postgres user, and make sure the install’s bin folder is on your PATH (the installer offers this).
2. Create the track’s database. All hands-on work in this track happens in one database, separate from your Spring project’s:
createdb -U postgres splitease_sql
psql -U postgres splitease_sql
The prompt changes to splitease_sql=#. You’re in. Everything you type here goes straight to PostgreSQL — no Java, no Hibernate, no HTTP.
3. The five psql commands you need. psql has dozens of backslash commands; these five cover this entire track:
| Command | What it does |
|---|---|
\c dbname | Connect to a different database |
\dt | List all tables in the current database |
\d tablename | Describe one table — columns, types, constraints, indexes |
\x | Toggle expanded display — wide rows print vertically, readable |
\q | Quit |
Everything else is plain SQL ending in a semicolon. Forget the semicolon and psql just waits for more input — that’s the number one beginner confusion, now pre-solved.
The Modules
| # | Module | What it gives you |
|---|---|---|
| 01 | The Relational Model | What a table really is, and constraints — the cheapest tests you’ll ever write |
| 02 | Reading Data | SELECT, WHERE, ORDER BY — and the full pain of NULL’s three-valued logic |
| 03 | Joins | Combining tables row by row; where the NULLs in a LEFT JOIN come from |
| 04 | Aggregation & Window Functions | GROUP BY, HAVING, and the window functions that answer real business questions |
| 05 | Data Modeling | Design the full SplitEase schema from requirements — normalization with a spine |
| 06 | Indexes & Query Plans | Why queries are slow, EXPLAIN ANALYZE, and what an index actually costs |
| 07 | Transactions & Isolation | COMMIT, ROLLBACK, and why concurrent money math doesn’t corrupt |
| 08 | Capstone: SplitEase, Interrogated | Every skill, loose on your own data — settle the balances in pure SQL |
Before Photo — No Shame In Zero
Three questions. If you can’t answer them today, perfect — that’s the point of a before photo. Re-take this after module 08.
Scored zero? Good. The gap between this photo and the after photo is the track.
Start here → SQL 01 — The Relational Model