SQL and Databases
Design tables, write correct SQL, read a query plan, and run a relational database safely.
Start reading
7 pages
SQL and Databases in seven pages
- 1On tables and keysA relational database stores data in tables
- 2On queriesSELECT asks a question about a table
- 3On indexesAn index trades write speed for read speed
- 4On query plansA query is parsed, planned, then executed
- 5On transactionsA transaction is all or nothing
- 6On schema design and migrationsStore each fact once
- 7On productionConnections are expensive, so pool them
- ?Quiz8 questions to check it stuck
Sources
Facts checked 2 December 2026 against:
- PostgreSQL 19 documentation: Transaction Isolation
- PostgreSQL 19 documentation: Constraints
- PostgreSQL 19 documentation: Multicolumn Indexes
- PostgreSQL 19 documentation: Index-Only Scans and Covering Indexes
- PostgreSQL 19 documentation: Using EXPLAIN
- PostgreSQL 19 documentation: ALTER TABLE
- PostgreSQL 19 documentation: CREATE INDEX
- PostgreSQL 19 documentation: Log-Shipping Standby Servers
- PostgreSQL 19 documentation: Continuous Archiving and Point-in-Time Recovery
- MySQL 8.4 Reference Manual: InnoDB Transaction Isolation Levels
- SQLite: Isolation In SQLite
- PgBouncer: Features
- OWASP SQL Injection Prevention Cheat Sheet
- Use The Index, Luke: Paging Through Results
- Use The Index, Luke: Anatomy of an Index, the B-Tree
- Martin Fowler: Parallel Change (expand and contract)
- Amazon DynamoDB Developer Guide: NoSQL design