SQL & Relational Database Design: The Hands-On Practice Workbook Cover
Precision Technical Press Enterprise Systems & Technical Authoring Series · Book 2

SQL & Relational Database Design: The Hands-On Practice Workbook

Schema Architecture, Complex Queries, Window Functions, and Performance Optimization for Analysts & Engineers

Most SQL tutorials and introductory books suffer from the exact same fatal flaw: they teach syntax using disconnected, three-row toy tables. In production, relational databases are heavily normalized and massive—where a careless join silently doubles revenue rows or a non-SARGable predicate triggers a full sequential scan across millions of records.

Engineered around three coherent enterprise relational schemas—Apex Retail Operations, Metro Health Clinical Systems, and Vanguard Freight & Logistics—this 146-page large-format workbook builds permanent muscle memory across 30 structured topics, 60 hands-on drills, and a 100% verified ANSI SQL:2016 answer key.

Print Paperback (8.5" × 11") $27.99 146-Page Lay-Flat Practice Workbook
Kindle eBook Edition $9.99 Reflowable EPUB3 · Complete Code & Solutions
3 Schemas Enterprise DDL/DML
60 Drills Guided & Production
ANSI SQL:2016 Postgres · MySQL · DuckDB
100% Verified Complete Answer Key
Precision Practice Pedagogy

Why This Workbook Outperforms Passive SQL Textbooks

Zero disconnected toy tables, zero hand-waving, and deterministic execution tracing on every topic.

01

The 4-Page Standardized Cadence

Every topic follows a strict 4-page modular sequence: Page 1 Core Mechanics & Relational Invariants, Page 2 Annotated Enterprise SQL & Trace, Page 3 Guided Fill-in Practice, and Page 4 Unassisted Production Challenge.

02

Three Enterprise Production Schemas

All 60 exercises run against three 3NF schemas: apex_retail (e-commerce orders & inventory), metro_health (synthetic ambulatory encounters), and vanguard_freight (intermodal waybills & delay telemetry).

03

6-Stage Logical Execution Pipeline

Eliminate alias scope errors, three-valued logic (NULL) traps, and asymmetric join fan-out by tracing queries in true engine order: FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY.

04

Window Framing & B-Tree Tuning

Go far beyond basic queries: master ROWS vs RANGE window frames, recursive CTE hierarchy traversals, composite B-Tree leftmost prefix rules, and refactoring non-SARGable predicates with EXPLAIN ANALYZE.

Complete Curriculum

30 Topics Across 6 Engineering Modules + Full Answer Key

Structured from relational algebra and 3NF schema modeling to analytical window framing and query plan optimization.

Modules 1–2

Relational Schema Architecture, Normalization & Execution Order

Mod 01
Relational Schema Architecture & Normalization (Topics 1.1–1.5)

Entity-Relationship mapping, associative M:N junction tables, candidate/surrogate keys, referential actions (RESTRICT vs CASCADE), and systematic decomposition through 1NF, 2NF, and 3NF.

Mod 02
Core Query Foundations & Logical Execution Order (Topics 2.1–2.5)

The 6-stage database execution pipeline, column projection & COALESCE, three-valued predicate logic (IS DISTINCT FROM), deterministic keyset pagination, and CASE WHEN conditional transforms.

Modules 3–4

Multi-Table Relational Algebra, Grouping Sets & Recursive CTEs

Mod 03
Multi-Table Joins & Relational Algebra (Topics 3.1–3.5)

Inner joins, preserving outer join asymmetry (ON vs WHERE placement), full outer join gap reconciliation, Cartesian cross joins, and hierarchical self-joins.

Mod 04
Aggregations, Grouping Sets, Subqueries & CTEs (Topics 4.1–4.5)

Vector aggregations & nullable arithmetic, HAVING partition filters, multidimensional ROLLUP, CUBE & GROUPING SETS, correlated EXISTS vs NOT IN, and recursive CTE trees.

Modules 5–6

Analytical Window Framing, B-Tree Indexing & Query Plan Tuning

Mod 05
Advanced Window Functions & Analytical Framing (Topics 5.1–5.5)

The anatomy of OVER(PARTITION BY ... ORDER BY ...), ranking algorithms (ROW_NUMBER, RANK, DENSE_RANK, NTILE), LEAD/LAG offsets, ROWS vs RANGE framing, and cohort retention.

Mod 06
Indexing Mechanics, Execution Plans & Anti-Patterns (Topics 6.1–6.5)

B-Tree architecture & index-only scans, composite index leftmost prefix rules, reading EXPLAIN ANALYZE cost trees, SARGability predicate refactoring, and ACID isolation levels (G1, P2, A3).

Digital Database Companion · $79 Value

The SQL Enterprise Schemas Starter Kit & Execution Order Desk Card

Every DDL schema definition, synthetic seed dataset, reference verification query, and printable execution-order quick reference from the workbook—packaged for immediate execution in PostgreSQL, SQLite, DuckDB, MySQL, and Snowflake.

Instant Engineering Download · 100% Free

Spin Up All 3 Enterprise Practice Databases in 60 Seconds

Enter your analyst or engineering email below to immediately download the runnable SQL schema & seed package.

apex_retail.sql ($19) metro_health.sql ($19) vanguard_freight.sql ($19) Reference Queries ($12) Execution Order PDF ($10)
Total Engineering Value: $79.00 Included Free with Workbook
Instant Access · ANSI SQL:2016 · Postgres / SQLite / DuckDB · Zero Spam Or download ANSI SQL Execution Order Desk Card (PDF) →
01

Apex Retail Operations Schema (.sql)

Complete 3NF DDL and seed rows for customers, products, orders, order_items, and inventory with composite uniqueness and check constraints.

schemas/01_apex_retail_schema_and_seed.sql
02

Metro Health Clinical Schema (.sql)

100% synthetic outpatient healthcare schema (departments, providers, patients, encounters, diagnoses) for practicing audit-safe clinical analytics.

schemas/02_metro_health_schema_and_seed.sql
03

Vanguard Freight Logistics Schema (.sql)

Global intermodal supply chain schema (carriers, warehouses, shipments, waybills, tracking_events) for temporal lead/lag and transit telemetry drills.

schemas/03_vanguard_freight_schema_and_seed.sql
04

Modules 1–6 Verification Queries (.sql)

Runnable benchmark solutions demonstrating fan-out-safe left joins, correlated EXISTS probes, ROWS BETWEEN window frames, and SARGable timestamp predicates.

solutions/module_1_to_6_reference_queries.sql
05

ANSI SQL Execution Order Desk Card (PDF)

Printable US-Letter reference matrix detailing the 6-stage query pipeline, SARGable B-Tree index transformations, ROWS vs RANGE framing, and ACID isolation levels.

reference/ANSI-SQL-Execution-Order-Quick-Reference.pdf
06
Corporate Analytics & Engineering Teams

Team Training & Cohort Licensing Tiers

Equip your data analytics, BI, or backend engineering cohort with physical lay-flat practice workbooks, internal team PDF rights, and interview grading rubrics.

Team Tier · Up to 10 Seats

Analytics Team Practice Pack

$245 / Team License & 5 Print Workbooks

Designed for analytics engineering pods and BI teams standardizing SQL code review and query performance discipline.

5 Lay-Flat Paperback Workbooks: Shipped directly to your office or engineering lead (146 pages, 8.5" × 11").
10-Seat Digital PDF & EPUB3 License: DRM-free digital editions licensed for internal team distribution up to 10 seats.
Complete DDL/DML Enterprise Seed Suite: Ready-to-load scripts for PostgreSQL, DuckDB, SQLite, MySQL, and Snowflake.
Author Profile

About Owen Thackeray

Precision Technical Press · Enterprise Systems & Technical Authoring Series

Owen Thackeray writes practical, workbench-first handbooks for engineers, data analysts, and technical communicators who build and maintain long-lived enterprise systems. His books favor explicit relational invariants, real failure modes, and scripts you can verify on your own machine.

Published independently by Precision Technical Press, Book 2 in the Enterprise Systems & Technical Authoring Series pairs with Book 1 (Adobe FrameMaker Technical Documentation Handbook) to equip technical teams with rigorous, primary-source reference manuals.

Official Trademark & Synthetic Data Notice (Decision 27 Compliant):

ANSI® and ISO® are registered trademarks of the American National Standards Institute and the International Organization for Standardization. PostgreSQL®, MySQL®, Oracle®, Snowflake®, and Microsoft® SQL Server® are registered trademarks of their respective owners. This independent technical workbook is published by Precision Technical Press and is not affiliated with, sponsored by, or endorsed by ANSI, ISO, or any database software vendor. All enterprise schemas (apex_retail, metro_health, vanguard_freight), clinical encounters, and shipment manifests are 100% synthetic educational datasets.