Cover image for Relational Theory for Computer Professionals

Book description

This book shows you what a real relational product would be like, and how and why it would be so much better than what’s currently available. Most books try to use SQL as a vehicle for teaching relational theory, but this book deliberately takes the opposite approach. Its primary aim is to teach relational theory as such. Then it uses that theory as a vehicle for teaching SQL, showing in particular how that theory can help with the practical problem of using SQL correctly and productively.

Table of Contents

  1. Dedication
  2. Special Upgrade Offer
  3.  
  4. About the Author
  5. Preface
    1. Who Should Read This Book
    2. Structure of the Book
    3. Acknowledgments
  6. I. Foundations
    1. 1. Basic Database Concepts
      1. What’s a database?
        1. The Running Example
      2. What’s a DBMS?
        1. Data Independence
        2. Other DBMS Functions
      3. What’s a relational DBMS?
      4. Database systems vs. programming systems
        1. More on Types
      5. Exercises
      6. Answers
    2. 2. Relations and Relvars
      1. Relations
        1. Attributes
        2. Tuples
        3. Properties of Relations
      2. Relvars
      3. Exercises
      4. Answers
    3. 3. Keys, Foreign Keys, and Related Matters
      1. Integrity constraints
      2. Keys
      3. Foreign keys
      4. Relvar definitions
      5. Loading the database
      6. Database systems vs. programming systems
      7. Exercises
      8. Answers
    4. 4. Relational Operators I
      1. Codd’s original algebra
      2. Restrict
      3. Project
        1. Closure Revisited
      4. Exercises I
      5. Answers I
      6. Union, intersection, and difference
        1. Union
        2. Intersection
        3. Difference
        4. Some Formal Properties
      7. Rename
      8. Exercises II
      9. Answers II
      10. Join
        1. Cartesian Product
        2. Intersection Revisited
        3. Primitive Operators
      11. Relational comparisons
      12. Update operator expansions
      13. Exercises III
      14. Answers III
    5. 5. Relational Operators II
      1. MATCHING and NOT MATCHING
      2. EXTEND
      3. Image relations
      4. Aggregation and summarization
        1. Summarization
        2. Explicit SUMMARIZE
        3. “Generalized Restriction”
      5. Exercises
      6. Answers
    6. 6. Constraints and Predicates
      1. Database constraints
      2. Relvar predicates
        1. Relations vs. Types
      3. Predicates vs. constraints
      4. Exercises
      5. Answers
    7. 7. The Relational Model
      1. The relational model defined
      2. Types
      3. The RELATION type generator
      4. Relation variables
      5. Relational assignment
      6. Relational operators
        1. Security
        2. Views
      7. Concluding remarks
  7. II. Transactions and Database Design
    1. 8. Transactions
      1. What’s a transaction?
      2. Recovery
        1. The Recovery Log
        2. The ACID Properties
      3. Concurrency
      4. Locking
      5. A remark on SQL
      6. Exercises
      7. Answers
    2. 9. Database Design
      1. Nonloss decomposition
      2. Functional dependencies
        1. Irreducible FDs
      3. Second normal form
      4. Third normal form
      5. Boyce/Codd normal form
      6. Concluding remarks
      7. Exercises
      8. Answers
  8. III. SQL
    1. 10. SQL Tables
      1. A little history
      2. Basic concepts
      3. Properties of tables
        1. More on Terminology
      4. Table updates
      5. Equality comparisons
      6. Table definitions
        1. “Table Literals”
      7. SQL systems vs. programming systems
      8. Exercises
      9. Answers
    2. 11. SQL Operators I
      1. Restrict
      2. Project
      3. Union, intersection, and difference
        1. Formal Properties
      4. Rename
      5. Exercises I
      6. Answers I
      7. Join
        1. Alternative Formulations
        2. Formal Properties
        3. Cartesian Product
      8. Evaluating table expressions
      9. Table comparisons
      10. Displaying results
      11. Exercises II
      12. Answers II
    3. 12. SQL Operators II
      1. MATCHING and NOT MATCHING
      2. EXTEND
      3. Image relations
      4. Aggregation and summarization
        1. Summarization
        2. “Generalized Restriction”
      5. Exercises
      6. Answers
    4. 13. SQL Constraints
      1. Database constraints
      2. Type constraints
      3. Exercises
      4. Answers
    5. 14. SQL vs. the Relational Model
      1. Some generalities
      2. Some SQL departures from the relational model
      3. Exercises
      4. Answers
  9. IV. Appendixes
    1. A. A Tutorial D Grammar
      1. Expressions
      2. Assignments
    2. B. TABLE_DUM and TABLE_DEE
    3. C. Set Theory
      1. What’s a set?
      2. Subsets and supersets
        1. Exercises
        2. Answers
      3. Set operators
        1. Exercises
        2. Answers
      4. Some identities
        1. Exercises
        2. Answers
      5. The algebra of sets
      6. Cartesian product
      7. Concluding remarks
    4. D. Relational Calculus
      1. Sample queries
      2. Sample constraints
      3. A simplified grammar
      4. Exercises
      5. Answers
    5. E. A Guide to Further Reading
      1. Papers by E. F. Codd
      2. Books by C. J. Date
      3. Books by C. J. Date and Hugh Darwen
      4. Other Publications Related to SQL
      5. Miscellaneous
  10. Index
  11. About the Author
  12. Special Upgrade Offer
  13. Copyright