Tables, keys, relationships, JOINs, aggregation, normalization, indexes, and transactions in PostgreSQL — learned by building the database of a small online shop.
Almost every application you will ever work on keeps its data in a relational database: the customers and orders of a shop, the users and posts of a social app, the accounts and transactions of a bank. Behind the framework and the API, there is a set of tables and a language, SQL, that asks questions of them. A developer who is comfortable with SQL can answer "which customers haven't ordered in 90 days?" in one query, while one who isn't writes a loop that is slow, long, and wrong.
This series teaches SQL and relational thinking from zero, using
PostgreSQL, one of the most widely used open-source databases. You
will learn how to design tables and constrain them so bad data cannot get
in, how to connect tables with primary and foreign keys, and how to
combine them with JOIN. You will summarize data with GROUP BY, break
big questions into subqueries and CTEs, and learn what normalization
really means. Then you will see why a query is slow, how an index fixes
it, and how transactions keep your data correct when something fails
halfway.
You won't just read about it. Across the series you build shopdb,
the database of a small online shop with customers, products, categories,
orders, and order items. Each chapter adds one idea to it: tables first,
then data, queries, relationships, joins, reports, a cleaner design, a
faster one, and finally a safe checkout that you call from Node.js. By the
end you have a real schema, a script to rebuild it from scratch, and a
set of queries you wrote yourself.
You need to be comfortable with the terminal from Command Line Basics. PostgreSQL runs in a container, so a first look at Docker helps, but the setup chapter gives you every command you need. The last chapter uses a little JavaScript, so JavaScript & TypeScript Fundamentals is useful there, and chapter 11 refers back to Big-O from Math for Programmers. Everything is free and runs on your own computer.
ORMs, NoSQL databases, database administration (backups, replication, tuning servers), and application-level frameworks are deliberately left out. Using a database from a backend framework is covered in the Backend track.