Databases and SQL with PostgreSQL
Understand relational data, SQL, and PostgreSQL through clear, prepared examples.
Levels indicate concept complexity and prerequisites, not learner progress.
Beginner
- Tables, Keys, and Missing Values — Read a relational table and distinguish a key from a missing value.
- Reading Data with SELECT — Filter, order, rename, and limit rows in a prepared PostgreSQL query.
- Changing Rows and Using Transactions — Follow inserts, updates, deletes, and a rollback using fictional data.
Intermediate
- Relationships, Constraints, and Normalisation — Connect books to authors while protecting the relationships between records.
- Combining Tables with Joins — Compare matching rows with an outer join that retains unmatched books.
- Grouping and Aggregating Rows — Summarise books by author without confusing missing values and empty groups.
- Asking Questions with Subqueries — Use an inner query to compare each book with the average known page count.
- Reusable Queries with Views — Follow a view as its underlying rows change inside a transaction.
- Transactions and Consistent Changes — Follow a two-account transfer through commit and reason about failure.
Advanced
- Indexes and Their Trade-offs — Understand when an index can help and what it costs to maintain.
- Reading and Measuring Query Plans — Read a plan as an estimate and measure carefully before tuning.
- Structuring Queries with CTEs — Name intermediate query results without assuming a fixed execution strategy.
- Window Functions and Ranking — Rank rows within groups while preserving individual rows.
- JSONB and PostgreSQL-Specific SQL — Distinguish missing JSON keys from JSON null and SQL NULL.
- MVCC and Transaction Isolation — Compare statement and transaction snapshots through a prepared two-session schedule.
- Roles and Least-Privilege Access — Separate object permissions and understand the limits of a revoke.
- Backups and Recovery Verification — Distinguish an archive from a tested recovery process.
Expert
- Locks, Deadlocks, and Safe Retries — Trace a wait-for cycle and recover safely from a failed transaction.
- Isolation Anomalies and Write Skew — See why stable snapshots do not automatically protect cross-row rules.
- Tuning Queries Against a Workload — Evaluate a candidate index using representative reads and writes.
- Partitioning and Pruning — Route date ranges and evaluate partition pruning and its trade-offs.
- Replication Lag and Failover — Follow a committed change across an asynchronous standby failure.
- Recovery Testing and Data Integrity — Compare a restored point with independent integrity expectations and recovery objectives.
