You are previewing Applied Mathematics for Database Professionals.
O'Reilly logo
Applied Mathematics for Database Professionals

Book Description

Relational databases hold data, right? They do indeed, but to think of a database as nothing more than a container for data is to miss out on the profound power that underlies relational technology. A far more powerful way of thinking lies in relational technologys foundation in the mathematical disciplines of logic and set theory.

Databases contain truths or propositions describing some area of interest such as a business. Those truths are organized into sets. Operations from logic and set theory can be applied to existing sets of truths to derive new sets of truths. Applied Mathematics for Database Professionals introduces you to this way of thinking, to the logic and set theory that underlies relational database technology. All this may sound abstract now, but there are profound benefits from the deeper understanding youll gain from this book.

The math that you'll learn in this book will put you above the level of understanding of most database professionals today. You'll better understand the technology and be able to apply it more effectively. You'll avoid data anomalies like redundancy and inconsistency. Understanding whats in this book will take your mastery of relational technology to heights you may not have thought possible.

This book is reviewed and endorsed by C. J. Date and features a foreword by the same.

Table of Contents

  1. Coverpage
  2. Titlepage
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. Foreword
  8. About the Authors
  9. About the Technical Reviewers
  10. Acknowledgments
  11. Preface
  12. Introduction
  13. Part 1: The Mathematics
    1. Chapter 1: Logic: Introduction
      1. The History of Logic
      2. Values, Variables, and Types
      3. Propositions and Predicates
      4. Logical Connectives
        1. Simple and Compound Predicates
        2. Using Parentheses and Operator Precedence Rules
      5. Truth Tables
        1. Implication
        2. Predicate Strength
        3. Going a Little Further
      6. Functional Completeness
      7. Special Predicate Categories
        1. Tautologies and Contradictions
        2. Modus Ponens and Modus Tollens
      8. Logical Equivalences and Rewrite Rules
        1. Rewrite Rules
        2. Using Existing Rewrite Rules to Prove New Ones
      9. Chapter Summary
      10. Exercises
    2. Chapter 2: Set Theory: Introduction
      1. Sets and Elements
      2. Methods to Specify Sets
        1. Enumerative Method
        2. Predicative Method
        3. Substitutive Method
        4. Hybrid Method
      3. Venn Diagrams
      4. Cardinality and Singleton Sets
        1. Singleton Sets
        2. The Choose Operator
      5. Subsets
      6. Union, Intersection, and Difference
        1. Properties of Set Operators
        2. Set Operators and Disjoint Sets
        3. Set Operators and the Empty Set
      7. Powersets and Partitions
        1. Union of a Set of Sets
        2. Partitions
      8. Ordered Pairs and Cartesian Product
        1. Ordered Pairs
        2. Cartesian Product
      9. Sum Operator
      10. Some Convenient Shorthand Set Notations
      11. Chapter Summary
      12. Exercises
    3. Chapter 3: Some More Logic
      1. Algebraic Properties
        1. Identity
        2. Commutativity
        3. Associativity
        4. Distributivity
        5. Reflexivity
        6. Transitivity
        7. De Morgan Laws
        8. Idempotence
        9. Double Negation (or Involution)
        10. Absorption
      2. Quantifiers
        1. Quantifiers and Finite Sets
        2. Quantification Over the Empty Set
        3. Nesting Quantifiers
        4. Distributive Properties of Quantifiers
        5. Negation of Quantifiers
        6. Rewrite Rules with Quantifiers
      3. Normal Forms
        1. Conjunctive Normal Form
        2. Disjunctive Normal Form
        3. Finding the Normal Form for a Given Predicate
      4. Chapter Summary
      5. Exercises
    4. Chapter 4: Relations and Functions
      1. Binary Relations
        1. Ordered Pairs and Cartesian Product Revisited
        2. Binary Relations
      2. Functions
        1. Domain and Range of Functions
        2. Identity Function
        3. Subset of a Function
      3. Operations on Functions
        1. Union, Intersection, and Difference
        2. Limitation of a Function
      4. Set Functions
        1. Characterizations
        2. External Predicates
        3. The Generalized Product of a Set Function
        4. A Preview of Constraint Specification
      5. Function Composition
      6. Chapter Summary
      7. Exercises
  14. Part 2: The Application
    1. Chapter 5: Tables and Database States
      1. Terminology
        1. Database Design
        2. Database Variable
        3. Database Universe
        4. Database State
        5. Database
        6. Database Management System (DBMS)
        7. Table Design
        8. Table Structure
        9. Table
      2. Tables
        1. Formal Specification of a Table
        2. Shorthand Notation
        3. Table Construction
      3. Database States
        1. Formal Representation of a Database State
        2. Database Skeleton
      4. Operations on Tables
        1. Union, Intersection, and Difference
        2. Restriction
        3. Join
        4. Attribute Renaming
        5. Extension
        6. Aggregation
      5. Chapter Summary
      6. Exercises
    2. Chapter 6: Tuple, Table, and Database Predicates
      1. Tuple Predicates
      2. Table Predicates
      3. Database Predicates
      4. A Few Remarks on Data Integrity Predicates
      5. Common Patterns of Table and Database Predicates
        1. Unique Identification Predicate
        2. Subset Requirement Predicate
        3. Specialization Predicate
        4. Generalization
        5. Tuple-in-Join Predicate
      6. Chapter Summary
      7. Exercises
    3. Chapter 7: Specifying Database Designs
      1. Documenting Databases and Constraints
      2. The Layers Inside a Database Design
        1. Top-Down View of a Database
        2. Classification Schema for Constraints
      3. Specifying the Example Database Design
        1. Database Skeleton
        2. Characterizations
        3. Tuple Universes
        4. Table Universes
        5. Database Universe
      4. Chapter Summary
      5. Exercises
    4. Chapter 8: Specifying State Transition Constraints
      1. More Data Integrity Predicates
        1. A Simple Example
        2. State Transition Predicates
      2. State Transition Constraints
        1. State Transition Universe
        2. Completing the Example Database Design
      3. Chapter Summary
      4. Exercises
    5. Chapter 9: Data Retrieval
      1. Formally Specifying Queries
      2. Example Queries Over DB_UEX
      3. A Remark on Negations
      4. Chapter Summary
      5. Exercises
    6. Chapter 10: Data Manipulation
      1. Formally Specifying Transactions
      2. Example Transactions Over DB_UEX
      3. Chapter Summary
      4. Exercises
  15. Part 3: The Implementation
    1. Chapter 11: Implementing Database Designs in Oracle
      1. Introduction
      2. Window-on-Data Applications
        1. Classifying Window-on-Data Application Code
      3. Implementing Data Integrity Code
        1. Alternative Implementation Strategies
        2. Order of Preference
      4. Implementing Table Structures
      5. Implementing Attribute Constraints
      6. Implementing Tuple Constraints
      7. Table Constraint Implementation Issues
        1. DI Code Execution Models
        2. DI Code Serialization
      8. Implementing Table Constraints
      9. Implementing Database Constraints
      10. Implementing Transition Constraints
      11. Bringing Deferred Checking into the Picture
        1. Why Deferred Checking?
        2. Outline of Execution Model for Deferred Checking
      12. The RuleGen Framework
      13. Chapter Summary
    2. Chapter 12: Summary and Conclusions
      1. Summary
      2. Conclusions
  16. Part 4: Appendixes
    1. Appendix A: Formal Definition of Example Database
      1. Bird’s Eye Overview
      2. Database Skeleton DB_S
      3. Table Universe Definitions
        1. Some Convenient Sets
        2. Table Universe for EMP
        3. Table Universe for SREP
        4. Table Universe for MEMP
        5. Table Universe for TERM
        6. Table Universe for DEPT
        7. Table Universe for GRD
        8. Table Universe for CRS
        9. Table Universe for OFFR
        10. Table Universe for REG
        11. Table Universe for HIST
      4. Database Characterization DBCH
      5. Database Universe DB_UEX
      6. State Transition Universe TX_UEX
    2. Appendix B: Symbols
    3. Appendix C: Bibliography
      1. Original Writings That Introduce the Methodology Demonstrated in This Book
      2. Recommended Reading in the Area of the Underlying Mathematical Theories
      3. Seminal Writings That Introduce the General Theory of Data Management
      4. Recommended Reading on Relational Database Management
      5. Research Papers on Implementing Data Integrity Constraints and Related Subjects
      6. Previous Related Writings of the Authors
    4. Appendix D: Nulls and Three (or More) Valued Logic
      1. To Be Applicable or Not
        1. Inapplicable
        2. Not Yet Applicable
        3. Nice to Know
        4. Implementation Guidelines
      2. Three (or More) Valued Logic
        1. Unknown
        2. Truth Tables of Three-Valued Logic
        3. Missing Operators
        4. Three-Valued Logic, Tautologies, and Rewrite Rules
        5. Handling Three-Valued Logic
        6. Four-Valued Logic
    5. Appendix E: Answers to Selected Exercises
      1. Chapter 1 Answers
      2. Chapter 2 Answers
      3. Chapter 3 Answers
      4. Chapter 4 Answers
      5. Chapter 5 Answers
      6. Chapter 6 Answers
      7. Chapter 7 Answers
      8. Chapter 8 Answers
      9. Chapter 9 Answers
      10. Chapter 10 Answers
    6. Index