You are previewing Database in Depth.
O'Reilly logo
Database in Depth

Book Description

This book sheds light on the principles behind the relational model, which is fundamental to all database-backed applications--and, consequently, most of the work that goes on in the computing world today. Database in Depth: The Relational Model for Practitioners goes beyond the hype and gets to the heart of how relational databases actually work. Ideal for experienced database developers and designers, this concise guide gives you a clear view of the technology--a view that's not influenced by any vendor or product. Featuring an extensive set of exercises, it will help you:

  • understand why and how the relational model is still directly relevant to modern database technology (and will remain so for the foreseeable future)

  • see why and how the SQL standard is seriously deficient

  • use the best current theoretical knowledge in the design of their databases and database applications

  • make informed decisions in their daily database professional activities

Database in Depth will appeal not only to database developers and designers, but also to a diverse field of professionals and academics, including database administrators (DBAs), information modelers, database consultants, and more. Virtually everyone who deals with relational databases should have at least a passing understanding of the fundamentals of working with relational models. Author C.J. Date has been involved with the relational model from its earliest days. An exceptionally clear-thinking writer, Date lays out principle and theory in a manner that is easily understood. Few others can speak as authoritatively the topic of relational databases as Date can.

Table of Contents

  1. Database in Depth
  2. Dedication
  3. SPECIAL OFFER: Upgrade this ebook with O’Reilly
  4. A Note Regarding Supplemental Files
  5. Foreword
  6. Preface
    1. What Makes This Book Different?
    2. Further Preliminaries
    3. Conventions Used in This Book
    4. Using Code Examples
    5. Safari Enabled
    6. Comments and Questions
    7. Acknowledgments
  7. One. Introduction
    1. 1.1. A Remark on Terminology
    2. 1.2. Principles, Not Products
    3. 1.3. A Review of the Original Model
      1. 1.3.1. Structural Features
      2. 1.3.2. Integrity Features
      3. 1.3.3. Manipulative Features
      4. 1.3.4. The Running Example
    4. 1.4. Model Versus Implementation
    5. 1.5. Properties of Relations
    6. 1.6. Relations Versus Relvars
    7. 1.7. Values Versus Variables
    8. 1.8. Summary
    9. 1.9. Exercises
      1. 1.9.1.
        1. 1.9.1.1. Exercise 1-1
        2. 1.9.1.2. Exercise 1-2
        3. 1.9.1.3. Exercise 1-3
        4. 1.9.1.4. Exercise 1-4
        5. 1.9.1.5. Exercise 1-5
        6. 1.9.1.6. Exercise 1-6
        7. 1.9.1.7. Exercise 1-7
        8. 1.9.1.8. Exercise 1-8
        9. 1.9.1.9. Exercise 1-9
        10. 1.9.1.10. Exercise 1-10
        11. 1.9.1.11. Exercise 1-11
        12. 1.9.1.12. Exercise 1-12
        13. 1.9.1.13. Exercise 1-13
        14. 1.9.1.14. Exercise 1-14
        15. 1.9.1.15. Exercise 1-15
        16. 1.9.1.16. Exercise 1-16
        17. 1.9.1.17. Exercise 1-17
        18. 1.9.1.18. Exercise 1-18
  8. Two. Relations Versus Types
    1. 2.1. Domain-Constrained Comparisons
    2. 2.2. Data Value Atomicity
    3. 2.3. So What's a Type?
    4. 2.4. Scalar Versus Nonscalar Types
    5. 2.5. Summary
    6. 2.6. Exercises
      1. 2.6.1.
        1. 2.6.1.1. Exercise 2-1
        2. 2.6.1.2. Exercise 2-2
        3. 2.6.1.3. Exercise 2-3
        4. 2.6.1.4. Exercise 2-4
        5. 2.6.1.5. Exercise 2-5
        6. 2.6.1.6. Exercise 2-6
        7. 2.6.1.7. Exercise 2-7
        8. 2.6.1.8. Exercise 2-8
        9. 2.6.1.9. Exercise 2-9
        10. 2.6.1.10. Exercise 2-10
        11. 2.6.1.11. Exercise 2-11
        12. 2.6.1.12. Exercise 2-12
        13. 2.6.1.13. Exercise 2-13
        14. 2.6.1.14. Exercise 2-14
        15. 2.6.1.15. Exercise 2-15
        16. 2.6.1.16. Exercise 2-16
        17. 2.6.1.17. Exercise 2-17
        18. 2.6.1.18. Exercise 2-18
        19. 2.6.1.19. Exercise 2-19
        20. 2.6.1.20. Exercise 2-20
        21. 2.6.1.21. Exercise 2-21
        22. 2.6.1.22. Exercise 2-22
        23. 2.6.1.23. Exercise 2-23
        24. 2.6.1.24. Exercise 2-24
  9. Three. Tuples and Relations
    1. 3.1. What's a Tuple?
    2. 3.2. Some Important Consequences
    3. 3.3. What's a Relation?
    4. 3.4. Further Important Consequences
    5. 3.5. Why Duplicate Tuples Are Prohibited
    6. 3.6. Why Nulls Are Prohibited
    7. 3.7. TABLE_DUM and TABLE_DEE
    8. 3.8. Summary
    9. 3.9. Exercises
      1. 3.9.1.
        1. 3.9.1.1. Exercise 3-1
        2. 3.9.1.2. Exercise 3-2
        3. 3.9.1.3. Exercise 3-3
        4. 3.9.1.4. Exercise 3-4
        5. 3.9.1.5. Exercise 3-5
        6. 3.9.1.6. Exercise 3-6
        7. 3.9.1.7. Exercise 3-7
        8. 3.9.1.8. Exercise 3-8
        9. 3.9.1.9. Exercise 3-9
        10. 3.9.1.10. Exercise 3-10
        11. 3.9.1.11. Exercise 3-11
        12. 3.9.1.12. Exercise 3-12
        13. 3.9.1.13. Exercise 3-13
        14. 3.9.1.14. Exercise 3-14
        15. 3.9.1.15. Exercise 3-15
        16. 3.9.1.16. Exercise 3-16
        17. 3.9.1.17. Exercise 3-17
        18. 3.9.1.18. Exercise 3-18
        19. 3.9.1.19. Exercise 3-19
        20. 3.9.1.20. Exercise 3-20
        21. 3.9.1.21. Exercise 3-21
  10. Four. Relation Variables
    1. 4.1. Updating Is Set-at-a-Time
    2. 4.2. More on Candidate Keys
    3. 4.3. More on Foreign Keys
    4. 4.4. More on Views
      1. 4.4.1. View Retrievals
      2. 4.4.2. View Updates
      3. 4.4.3. Miscellaneous Points
    5. 4.5. Relvars and Predicates
      1. 4.5.1. Relational Expressions
    6. 4.6. More on Relations Versus Types
    7. 4.7. Summary
    8. 4.8. Exercises
      1. 4.8.1.
        1. 4.8.1.1. Exercise 4-1
        2. 4.8.1.2. Exercise 4-2
        3. 4.8.1.3. Exercise 4-3
        4. 4.8.1.4. Exercise 4-4
        5. 4.8.1.5. Exercise 4-5
        6. 4.8.1.6. Exercise 4-6
        7. 4.8.1.7. Exercise 4-7
        8. 4.8.1.8. Exercise 4-8
        9. 4.8.1.9. Exercise 4-9
        10. 4.8.1.10. Exercise 4-10
        11. 4.8.1.11. Exercise 4-11
        12. 4.8.1.12. Exercise 4-12
        13. 4.8.1.13. Exercise 4-13
        14. 4.8.1.14. Exercise 4-14
        15. 4.8.1.15. Exercise 4-15
        16. 4.8.1.16. Exercise 4-16
        17. 4.8.1.17. Exercise 4-17
        18. 4.8.1.18. Exercise 4-18
        19. 4.8.1.19. Exercise 4-19
        20. 4.8.1.20. Exercise 4-20
        21. 4.8.1.21. Exercise 4-21
        22. 4.8.1.22. Exercise 4-22
        23. 4.8.1.23. Exercise 4-23
        24. 4.8.1.24. Exercise 4-24
        25. 4.8.1.25. Exercise 4-25
        26. 4.8.1.26. Exercise 4-26
        27. 4.8.1.27. Exercise 4-27
        28. 4.8.1.28. Exercise 4-28
        29. 4.8.1.29. Exercise 4-29
        30. 4.8.1.30. Exercise 4-30
  11. Five. Relational Algebra
    1. 5.1. More on Closure
    2. 5.2. The Original Operators
      1. 5.2.1. Restrict
      2. 5.2.2. Project
      3. 5.2.3. Join
      4. 5.2.4. Intersect
      5. 5.2.5. Union
      6. 5.2.6. Difference
      7. 5.2.7. Cartesian Product
      8. 5.2.8. Divide
      9. 5.2.9. Which Operators Are Primitive?
    3. 5.3. Evaluating SQL Expressions
    4. 5.4. Extend and Summarize
      1. 5.4.1. Extend
      2. 5.4.2. Summarize
    5. 5.5. Group and Ungroup
    6. 5.6. Expression Transformation
    7. 5.7. Relational Comparisons
    8. 5.8. More on Relational Assignment
    9. 5.9. The ORDER BY Operator
    10. 5.10. Summary
    11. 5.11. Exercises
      1. 5.11.1.
        1. 5.11.1.1. Exercise 5-1.
        2. 5.11.1.2. Exercise 5-2.
        3. 5.11.1.3. Exercise 5-3.
        4. 5.11.1.4. Exercise 5-4.
        5. 5.11.1.5. Exercise 5-5.
        6. 5.11.1.6. Exercise 5-6.
        7. 5.11.1.7. Exercise 5-7.
        8. 5.11.1.8. Exercise 5-8.
        9. 5.11.1.9. Exercise 5-9.
        10. 5.11.1.10. Exercise 5-10.
        11. 5.11.1.11. Exercise 5-11.
        12. 5.11.1.12. Exercise 5-12.
        13. 5.11.1.13. Exercise 5-13.
        14. 5.11.1.14. Exercise 5-14.
        15. 5.11.1.15. Exercise 5-15.
        16. 5.11.1.16. Exercise 5-16.
        17. 5.11.1.17. Exercise 5-17.
        18. 5.11.1.18. Exercise 5-18.
        19. 5.11.1.19. Exercise 5-19.
        20. 5.11.1.20. Exercise 5-20.
        21. 5.11.1.21. Exercise 5-21.
        22. 5.11.1.22. Exercise 5-22.
        23. 5.11.1.23. Exercise 5-23.
        24. 5.11.1.24. Exercise 5-24.
        25. 5.11.1.25. Exercise 5-25.
        26. 5.11.1.26. Exercise 5-26.
        27. 5.11.1.27. Exercise 5-27.
        28. 5.11.1.28. Exercise 5-28.
        29. 5.11.1.29. Exercise 5-29.
        30. 5.11.1.30. Exercise 5-30.
        31. 5.11.1.31. Exercise 5-31.
  12. Six. Integrity Constraints
    1. 6.1. Type Constraints
      1. 6.1.1. Selectors and THE_ Operators
      2. 6.1.2. Type Constraints Continued
    2. 6.2. Database Constraints
      1. 6.2.1. Example 1
      2. 6.2.2. Example 2
      3. 6.2.3. Example 3
      4. 6.2.4. Example 4
      5. 6.2.5. Example 5
    3. 6.3. Transactions
    4. 6.4. Why Database Constraint Checking Must Be Immediate
    5. 6.5. But Doesn't Some Checking Have to Be Deferred?
      1. 6.5.1. Multiple Assignment
    6. 6.6. Constraints and Predicates
    7. 6.7. Miscellaneous Issues
    8. 6.8. Summary
    9. 6.9. Exercises
      1. 6.9.1.
        1. 6.9.1.1. Exercise 6-1.
        2. 6.9.1.2. Exercise 6-2
        3. 6.9.1.3. Exercise 6-3
        4. 6.9.1.4. Exercise 6-4
        5. 6.9.1.5. Exercise 6-5
        6. 6.9.1.6. Exercise 6-6
        7. 6.9.1.7. Exercise 6-7
        8. 6.9.1.8. Exercise 6-8
        9. 6.9.1.9. Exercise 6-9
        10. 6.9.1.10. Exercise 6-10
        11. 6.9.1.11. Exercise 6-11
        12. 6.9.1.12. Exercise 6-12
        13. 6.9.1.13. Exercise 6-13
        14. 6.9.1.14. Exercise 6-14
        15. 6.9.1.15. Exercise 6-15
        16. 6.9.1.16. Exercise 6-16
        17. 6.9.1.17. Exercise 6-17
        18. 6.9.1.18. Exercise 6-18
        19. 6.9.1.19. Exercise 6-19
        20. 6.9.1.20. Exercise 6-20
        21. 6.9.1.21. Exercise 6-21
        22. 6.9.1.22. Exercise 6-22
        23. 6.9.1.23. Exercise 6-23
        24. 6.9.1.24. Exercise 6-24
        25. 6.9.1.25. Exercise 6-25
  13. Seven. Database Design Theory
    1. 7.1. The Place of Design Theory
    2. 7.2. Functional Dependencies and Boyce/Codd Normal Form
      1. 7.2.1. Nonloss Decomposition
      2. 7.2.2. But Isn't It All Just Common Sense?
      3. 7.2.3. 1NF, 2NF, 3NF
    3. 7.3. Join Dependencies and Fifth Normal Form
      1. 7.3.1. The Significance of 5NF
      2. 7.3.2. More on 5NF
    4. 7.4. Two Cheers for Normalization
    5. 7.5. Orthogonality
    6. 7.6. Some Remarks on Physical Design
    7. 7.7. Summary
    8. 7.8. Exercises
      1. 7.8.1.
        1. 7.8.1.1. Exercise 7-1
        2. 7.8.1.2. Exercise 7-2
        3. 7.8.1.3. Exercise 7-3
        4. 7.8.1.4. Exercise 7-4
        5. 7.8.1.5. Exercise 7-5
        6. 7.8.1.6. Exercise 7-6
        7. 7.8.1.7. Exercise 7-7
        8. 7.8.1.8. Exercise 7-8
        9. 7.8.1.9. Exercise 7-9
        10. 7.8.1.10. Exercise 7-10
        11. 7.8.1.11. Exercise 7-11
        12. 7.8.1.12. Exercise 7-12
        13. 7.8.1.13. Exercise 7-13
        14. 7.8.1.14. Exercise 7-14
        15. 7.8.1.15. Exercise 7-15
        16. 7.8.1.16. Exercise 7-16
        17. 7.8.1.17. Exercise 7-17
        18. 7.8.1.18. Exercise 7-18
        19. 7.8.1.19. Exercise 7-19
        20. 7.8.1.20. Exercise 7-20
        21. 7.8.1.21. Exercise 7-21
        22. 7.7.1.22. Exercise 7-22
        23. 7.8.1.23. Exercise 7-23
        24. 7.8.1.24. Exercise 7-24
        25. 7.8.1.25. Exercise 7-25
        26. 7.8.1.26. Exercise 7-26
        27. 7.8.1.27. Exercise 7-27
        28. 7.8.1.28. Exercise 7-28
  14. Eight. What Is the Relational Model?
    1. 8.1. The Relational Model Defined
      1. 5.1.1. Scalar Types
      2. 5.1.2. Relation Types
      3. 5.1.3. Relation Variables
      4. 5.1.4. Relational Assignment
      5. 5.1.5. Relational Operators
    2. 8.2. Objectives of the Relational Model
    3. 8.3. Some Database Principles
    4. 8.4. The Relational Model Versus Others
    5. 8.5. What Remains to Be Done?
      1. 5.5.1. Implementation
      2. 5.5.2. Foundations
      3. 5.5.3. Higher-Level Abstractions
      4. 5.5.4. Higher-Level Interfaces
      5. 5.5.5. So What About SQL?
    6. 8.6. Summary
    7. 8.7. Exercises
      1. 5.7.1.
        1. 5.7.1.1. Exercise 8-1
        2. 5.7.1.2. Exercise 8-2
        3. 5.7.1.3. Exercise 8-3
        4. 5.7.1.4. Exercise 8-4
        5. 5.7.1.5. Exercise 8-5
        6. 5.7.1.6. Exercise 8-6
        7. 5.7.1.7. Exercise 8-7
        8. 5.7.1.8. Exercise 8-8
        9. 5.7.1.9. Exercise 8-9
        10. 5.7.1.10. Exercise 8-10
        11. 5.7.1.11. Exercise 8-11
        12. 5.7.1.12. Exercise 8-12
        13. 5.7.1.13. Exercise 8-13
        14. 5.7.1.14. Exercise 8-14
        15. 5.7.1.15. Exercise 8-15
        16. 5.7.1.16. Exercise 8-16
        17. 5.7.1.17. Exercise 8-17
        18. 5.7.1.18. Exercise 8-18
        19. 5.7.1.19. Exercise 8-19
        20. 5.7.1.20. Exercise 8-20
        21. 5.7.1.21. Exercise 8-21
        22. 5.7.1.22. Exercise 8-22
        23. 5.7.1.23. Exercise 8-23
        24. 5.7.1.24. Exercise 8-24
        25. 5.7.1.25. Exercise 8-25
        26. 5.7.1.26. Exercise 8-26
        27. 5.7.1.27. Exercise 8-27
        28. 5.7.1.28. Exercise 8-28
        29. 5.7.1.29. Exercise 8-29
        30. 5.7.1.30. Exercise 8-30
        31. 5.7.1.31. Exercise 8-31
        32. 5.7.1.32. Exercise 8-32
        33. 5.7.1.33. Exercise 8-33
        34. 5.7.1.34. Exercise 8-34
        35. 5.7.1.35. Exercise 8-35
        36. 5.7.1.36. Exercise 8-36
        37. 5.7.1.37. Exercise 8-37
        38. 5.7.1.38. Exercise 8-38
        39. 5.7.1.39. Exercise 8-39
        40. 5.7.1.40. Exercise 8-40
        41. 5.7.1.41. Exercise 8-41
        42. 5.7.1.42. Exercise 8-42
        43. 5.7.1.43. Exercise 8-43
        44. 5.7.1.44. Exercise 8-44
        45. 5.7.1.45. Exercise 8-45
        46. 5.7.1.46. Exercise 8-46
        47. 5.7.1.47. Exercise 8-47
        48. 5.7.1.48. Exercise 8-48
        49. 5.7.1.49. Exercise 8-49
        50. 5.7.1.50. Exercise 8-50
        51. 5.7.1.51. Exercise 8-51
        52. 5.7.1.52. Exercise 8-52
        53. 5.7.1.53. Exercise 8-53
        54. 5.7.1.54. Exercise 8-54
        55. 5.7.1.55. Exercise 8-55
        56. 5.7.1.56. Exercise 8-56
        57. 5.7.1.57. Exercise 8-57
        58. 5.7.1.58. Exercise 8-58
        59. 5.7.1.59. Exercise 8-59
        60. 5.7.1.60. Exercise 8-60
  15. A. A Little Bit of Logic
    1. Propositions
    2. Predicates
    3. Quantification
    4. Free and Bound Variables
    5. More on Quantification
      1. We Don't Need Both Quantifiers
      2. Empty Ranges
      3. Defining EXISTS and FORALL
      4. Other Kinds of Quantifiers
    6. Database Constraints
    7. Queries
    8. Some Equivalences
    9. Summary
  16. B. Suggestions for Further Reading
  17. Colophon
  18. SPECIAL OFFER: Upgrade this ebook with O’Reilly
  19. Copyright