Contents

Preface to the First Edition

Preface to the Second Edition

Preface to the Third Edition

Chapter 1     Setting the Scene

The relational model is much misunderstood

Some remarks on terminology

Principles not products

A review of the original model

Model vs. implementation

Properties of relations

Base vs. derived relations

Relations vs. relvars

Values vs. variables

Concluding remarks

Exercises

Answers

Chapter 2     Types and Domains

Types and relations

Equality comparisons

Data value atomicity

What’s a type?

Scalar vs. nonscalar types

Scalar types in SQL

Type checking and coercion in SQL

Collations in SQL

Row and table types in SQL

Concluding remarks

Exercises

Answers

Chapter 3     Tuples and Relations, Rows and Tables

What’s a tuple?

Rows in SQL

What’s a relation?

Relations and their bodies

Relations are n-dimensional

Relational comparisons

TABLE_DUM and TABLE_DEE

Tables in SQL

Column naming in SQL

Concluding remarks

Exercises

Answers

Chapter 4     No Duplicates, No Nulls

What’s wrong with duplicates?

Duplicates: further issues

Avoiding duplicates in SQL

What’s wrong with nulls?

Avoiding nulls in SQL

A remark on outer join

Concluding remarks

Exercises

Answers

Chapter 5     Base Relvars, Base Tables

Updating is set level

Relational assignment

More on candidate keys

More on foreign keys

Relvars and predicates

Relations vs. types

Exercises

Answers

Chapter 6     SQL and Relational Algebra I: The Original Operators

Some preliminaries

More on closure

Restriction

Projection

Join

Union, intersection, and difference

Which operators are primitive?

Formulating expressions one step at a time

What do relational expressions mean?

Evaluating SQL table expressions

Expression transformation

The reliance on attribute names

Exercises

Answers

Chapter 7     SQL and Relational Algebra II: Additional Operators

Exclusive union

Semijoin and semidifference

Extend

Image relations

Divide

Aggregate operators

Image relations revisited

Summarization

Summarization revisited

Group, ungroup, and relation valued attributes

“What if” queries

A note on recursion

What about ORDER BY?

Exercises

Answers

Chapter 8     SQL and Constraints

Type constraints

Type constraints in SQL

Database constraints

Database constraints in SQL

Transactions

Why database constraint checking must be immediate

But doesn’t some checking have to be deferred?

Constraints and predicates

Miscellaneous issues

Exercises

Answers

Chapter 9     SQL and Views

Views are relvars

Views and predicates

Retrieval operations

Views and constraints

Update operations

What are views for?

Views and snapshots

Exercises

Answers

Chapter 10   SQL and Logic

Why do we need logic?

Simple and compound propositions

Simple and compound predicates

Quantification

Relational calculus

More on quantification

Some equivalences

Concluding remarks

Exercises

Answers

Chapter 11   Using Logic to Formulate SQL Expressions

Some transformation laws

Example 1: Logical implication

Example 2: Universal quantification

Example 3: Implication and universal quantification

Example 4: Correlated subqueries

Example 5: Naming subexpressions

Example 6: More on naming subexpressions

Example 7: Dealing with ambiguity

Example 8: Using COUNT

Example 9: Another variation

Example 10: UNIQUE quantification

Example 11: ALL or ANY comparisons

Example 12: GROUP BY and HAVING

Exercises

Answers

Chapter 12   Miscellaneous SQL Topics

SELECT *

Explicit tables

Dot qualification

Range variables

Subqueries

“Possibly nondeterministic” expressions

Empty sets

A simplified BNF grammar

Exercises

Answers

Appendix A  The Relational Model

The relational model vs. others

The significance of theory

The relational model defined

Database variables

Objectives of the relational model

Some database principles

What remains to be done?

Appendix B  SQL Departures from the Relational Model

Appendix C  A Relational Approach to Missing Information

Vertical decomposition

Horizontal decomposition

What do the shaded entries mean?

Constraints

Queries

More on predicates

Exercises

Answers

Appendix D  A Tutorial D Grammar

Appendix E  Summary of Recommendations

Appendix F  NoSQL and Relational Theory

Functional segmentation

Sharding

Eventual consistency

The Fernandez interview

Appendix G  Suggestions for Further Reading

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset