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