Chapter 23 Further Reading: Database Basics
Official Documentation
Python sqlite3 module https://docs.python.org/3/library/sqlite3.html The complete official reference for Python's built-in SQLite interface. Covers all methods, connection options, row factories, and adapters. Bookmark the "How-To Guides" section for practical patterns.
SQLAlchemy Documentation https://docs.sqlalchemy.org/ The full SQLAlchemy documentation is comprehensive and well-written. Start with the "ORM Quick Start" tutorial, then read "Using the ORM" for in-depth coverage of models, sessions, and queries.
PostgreSQL Documentation https://www.postgresql.org/docs/current/ The authoritative reference for PostgreSQL. Particularly useful: the SQL command reference and the chapter on data types. Even if you primarily use SQLite now, PostgreSQL documentation explains SQL standard behavior in precise detail.
Books
"Learning SQL" by Alan Beaulieu (O'Reilly) The most accessible introduction to SQL for those new to databases. Covers all the core concepts — queries, joins, aggregates, subqueries — with clear examples. Does not assume programming knowledge. Best read alongside this chapter.
"SQL Cookbook" by Anthony Molinaro and Robert de Graaf (O'Reilly) A recipe-based reference covering hundreds of practical SQL problems. Useful once you know the basics and want solutions to specific analytical questions. Good to have on your shelf rather than read cover-to-cover.
"Database Design for Mere Mortals" by Michael J. Hernandez (Addison-Wesley) The best book on relational database design for non-database specialists. Walks through entity-relationship modeling, normalization, and schema design with business examples. If Maya's case study resonated with you, this book will significantly improve your ability to design maintainable schemas.
"SQLAlchemy 2.0 Documentation" (online) Not a traditional book, but the official SQLAlchemy docs are genuinely readable. The "Unified Tutorial" covers both Core and ORM in a structured walkthrough. Worth reading straight through at least once.
Online Courses and Tutorials
SQLZoo (https://sqlzoo.net/) Interactive SQL exercises with an in-browser query interface. No installation required. Works through SELECT basics, aggregation, joins, and subqueries with progressively harder problems. Excellent for building SQL fluency quickly.
Mode Analytics SQL Tutorial (https://mode.com/sql-tutorial/) Well-structured tutorial that moves from basic SELECT to advanced analytical queries (window functions, CTEs). Uses real datasets. Written for analysts, so the business context is relevant.
Khan Academy — Intro to SQL (https://www.khanacademy.org/computing/computer-programming/sql) Beginner-friendly video and interactive exercise format. Good starting point if this chapter felt fast.
pgexercises.com PostgreSQL-specific practice problems ranging from simple to expert-level. All run in the browser against a real database. Excellent for reinforcing JOIN, aggregation, and subquery skills.
Tools
DB Browser for SQLite (https://sqlitebrowser.org/)
Free, open-source GUI for SQLite databases. Browse tables, run queries, and view data visually. Download this to inspect the acme_inventory.db and maya_consulting.db files created in this chapter's exercises. Works on Windows, macOS, and Linux.
DBeaver (https://dbeaver.io/) Free, open-source universal database client. Connects to SQLite, PostgreSQL, MySQL, SQL Server, and dozens of others. Includes a schema diagram viewer, query builder, and data export tools. The community edition is fully featured for all the databases in this book.
TablePlus (https://tableplus.com/) Clean, fast GUI for databases. Paid with a limited free tier. Popular with developers for its speed and modern interface. Excellent PostgreSQL support.
pgAdmin (https://www.pgadmin.org/) The official PostgreSQL administration tool. Free and open-source. More complex than DBeaver but deeper PostgreSQL-specific functionality.
Reference Cards
SQL Cheat Sheet — W3Schools (https://www.w3schools.com/sql/sql_cheatsheet.asp) Quick reference for SQL syntax. Keep a browser tab open while writing queries.
SQLAlchemy ORM Cheat Sheet — Search "SQLAlchemy ORM cheat sheet 2.0" for community-maintained quick references. The syntax changed significantly between SQLAlchemy 1.x and 2.0, so verify the version matches what you installed.
Going Deeper
"Designing Data-Intensive Applications" by Martin Kleppmann (O'Reilly) An advanced book on how databases work under the hood — transactions, replication, partitioning, consistency models. Not required reading for this textbook's scope, but the most important book in the field for developers who work with data at scale. Read it after you have worked with production databases for a year.
"High Performance MySQL" / "PostgreSQL: Up and Running" When you graduate from development to production and start caring about query performance, indexing strategy, and database tuning, these database-specific books become relevant. Not needed yet.
Alembic (https://alembic.sqlalchemy.org/) The standard database migration tool for SQLAlchemy. When your schema needs to change in production (adding columns, renaming tables), Alembic manages those changes safely with version control for your database schema. Worth learning as soon as you have a production application.
Practice Datasets
Northwind Database — A classic sample database representing a small trading company. Available in SQLite format at multiple GitHub repositories (search "northwind sqlite"). Contains customers, orders, products, employees, and suppliers — more complex than Acme Corp's schema and good for advanced JOIN practice.
Chinook Database — A sample database representing a digital music store. Available at https://github.com/lerocha/chinook-database. Good for practicing queries against a more normalized, real-world-shaped schema.
data.gov and Kaggle — Both offer CSV datasets on business, economics, and government topics that you can import into SQLite for practice. Start with a topic you find interesting — the engagement makes the SQL practice stick.