Chapter 5 Further Reading

IBM Official Documentation

  • DB2 for LUW 11.5 SQL Reference — Queries IBM Knowledge Center: Queries section of the SQL Reference. Covers the complete SELECT syntax, including all clauses discussed in this chapter and advanced features like recursive queries and lateral correlation. https://www.ibm.com/docs/en/db2/11.5?topic=queries

  • DB2 for z/OS 13 SQL Reference — SELECT Statement IBM Documentation: The definitive reference for SELECT on the z/OS platform, including platform-specific syntax variations and limits. https://www.ibm.com/docs/en/db2-for-zos/13

  • DB2 Built-In Functions Reference (LUW) Complete catalog of all built-in scalar functions, aggregate functions, table functions, and special registers. Includes syntax diagrams, parameter descriptions, and examples. https://www.ibm.com/docs/en/db2/11.5?topic=functions-built-in

  • DB2 Built-In Functions Reference (z/OS) The z/OS equivalent, covering the same function categories with z/OS-specific notes on behavior and compatibility. https://www.ibm.com/docs/en/db2-for-zos/13?topic=functions-built-in

Books

  • Mullins, Craig S. "DB2 Developer's Guide." 6th Edition. IBM Press. Chapter on basic SQL provides additional examples and context. Mullins covers both LUW and z/OS and includes practical advice accumulated from decades of DB2 consulting.

  • Date, C. J. "SQL and Relational Theory: How to Write Accurate SQL Code." 3rd Edition. O'Reilly, 2015. A rigorous treatment of how SQL relates to relational theory. The chapters on three-valued logic and NULL handling are particularly relevant to Section 5.8 of this chapter. Date is famously critical of NULL in SQL — reading his arguments will deepen your understanding of why NULL behaves as it does.

  • Celko, Joe. "Joe Celko's SQL for Smarties: Advanced SQL Programming." 5th Edition. Morgan Kaufmann, 2014. Celko's treatment of scalar expressions, CASE, and NULL handling goes far beyond the basics. His "thinking in sets" approach to SQL complements the procedural-to-declarative transition that many learners undergo.

  • Molinaro, Anthony. "SQL Cookbook." 2nd Edition. O'Reilly, 2020. A recipe-oriented book with hundreds of practical queries for common tasks. The recipes for string manipulation, date arithmetic, and NULL handling translate directly to DB2 with minimal adaptation.

Articles and Papers

  • Chamberlin, Donald D. "A Complete Guide to DB2 Universal Database." Morgan Kaufmann, 1998. Written by one of the co-inventors of SQL, this classic text provides deep insight into why DB2's SQL is designed the way it is. The discussion of the relational model and its SQL implementation remains valuable despite the book's age.

  • "Three-Valued Logic in SQL" — Various Sources Multiple database textbooks and blog posts explore the subtleties of SQL's three-valued logic. Search for "SQL three valued logic" for a range of treatments from introductory to academic. Understanding this topic well will prevent entire categories of bugs.

Online Resources

  • DB2 on Stack Overflow The db2 tag on Stack Overflow has thousands of answered questions about SELECT queries, function usage, NULL handling, and performance. A practical resource for troubleshooting specific query problems. https://stackoverflow.com/questions/tagged/db2

  • IDUG (International DB2 Users Group) IDUG publishes technical articles, conference presentations, and maintains discussion forums. Their content frequently covers SQL optimization techniques and best practices for both z/OS and LUW. https://www.idug.org

  • IBM Developer — Db2 Tutorials IBM's developer portal includes hands-on SQL tutorials with sample databases. These provide additional practice beyond the Meridian Bank examples in this textbook. https://developer.ibm.com/components/db2/

  • Chapter 2: The Relational Model — Formal definitions of selection, projection, and the relational algebra operations that underlie SELECT queries.
  • Chapter 4: Setting Up Your DB2 Environment — Instructions for creating and loading the Meridian National Bank database used in all Chapter 5 examples.
  • Chapter 6: Joining Tables — Extends SELECT to combine data from multiple tables using INNER JOIN, OUTER JOIN, CROSS JOIN, and self-joins.
  • Chapter 7: Aggregation and Grouping — Introduces GROUP BY, HAVING, and aggregate functions (COUNT, SUM, AVG, MIN, MAX) that build on the single-row queries in this chapter.
  • Chapter 14: Indexes and Query Performance — Explains how indexes affect the performance of WHERE, ORDER BY, and DISTINCT operations discussed here.

Further Reading for Chapter 5 of "IBM DB2: From First Query to Enterprise Architecture"