You are on page 1of 9

THE THEORY OF

RELATIONAL
DATABASES

/----A.
--WA

---

COMPUTER

M;
/

SCIENCE

PRESS

TABLE OF CONTENTS
xiv
xv

Preface ........................................................
Acknowledgements .............................................
1. RELATIONS
1.1.
1.2.
1.3.
1.4.
1.5.
1.6.

2.

RELATIONAL
2.1.
2.2.
2.3.
2.4.
2.5.
2.6.
2.7.

3.

MORE
3.1.
3.2.
3.3.
3.4.
3.5.

3.6.

AND RELATION

SCHEMES

.................

BrassTacks .........................................
Formalization of Relations ............................
Keys ...............................................
Updates to Relations .................................
Exercises ...........................................
Bibliography and Comments ..........................

OPERATORS

..............................

Boolean Operations ..................................


.................................
TheSelectOperator
The Project Operator. ................................
The Join Operator ...................................
Properties of Join ....................................
Exercises ...........................................
Bibliography and Comments ..........................

OPERATIONS

ON RELATIONS

...................

The Divide Operator .................................


Constant Relations. ..................................
................................
Renaming Attributes.
The Equijoin Operator ...............................
Extensions for Other Comparisons on Domains ..........
3.5.1. Extending Selection ..........................
3.5.2. The Theta-Join Operator ......................
Relational Algebra ...................................
3.6.1. Algebraic Expressions as Mappings .............
3.6.2.
Restricting the Set of Operators ................
Vii

1
1
2
4
5
8
10

11
11
13
15
16
18
22
24

25
25
26
27
29
31
32
33
34
35
36

...
VIII

Contents

3.7.
3.8.
3.9.
3.10.

4.

4.6.
4.7.
4.8.

..........................

42

5.7.
5.8.
5.9.
5.10.

FOR FUNCTIONAL

6.3.

DEPENDENCIES.

...........

Covers and Equivalence ..............................


Nonredundant Covers ................................
...............................
Extraneous Attributes.
Canonical Covers ....................................
The Structure of Nonredundant Covers .................
MinimumCovers..
..................................
.........................
5.6.1. Direct Determination
5.6.2. Computing Minimum Covers. ..................
OptimalCovers ......................................
Annular Covers and Compound Functional
Dependencies .......................................
Exercises ...........................................
Bibliography and Comments ..........................

DATABASES
6.1.
6.2.

DEPENDENCIES.

Definitions .........................................
Inference Axioms ....................................
Applying the Inference Axioms ........................
Completeness of the Inference Axioms ..................
Derivations and Derivation DAGs ......................
4.5.1. RAP-Derivation
Sequences ....................
4.5.2. Derivation DAGs .............................
4.5.3. More about Derivation DAGs ..................
Testing Membership in Ff ............................
Exercises ...........................................
Bibliography and Comments ..........................

COVERS
5.1.
5.2.
5.3.
5.4.
5.5.
5.6.

6.

37
38
39
41

FUNCTIONAL
4.1.
4.2.
4.3.
4.4.
4.5.

5.

TheSplitOperator
...................................
The Factor Operator .................................
Exercises ...........................................
Bibliography and Comments ..........................

AND NORMAL

FORMS .....................

Databases and Database Schemes. .....................


Normal Forms for Databases ..........................
6.2.1. First Normal Form ............................
6.2.2. Anomalies and Data Redundancy. ..............
6.2.3. Second Normal Form .........................
6.2.4. Third Normal Form ...........................
Normalization through Decomposition ..................

42
44
47
49
51
53
56
60
63
69
70

71
71
72
74
77
78
79
79
84
86
87
90
92

93
94
96
96
98
99
99
101

Contents
6.4.
6.5.

6.6.
6.7.
6.8.
6.9.

Shortcomings of Normalization through Decomposition ...


Normalization through Synthesis. ......................
6.5.1. Preliminary Results for the Synthesis Algorithm ...
6.5.2. Developing the Synthesis Algorithm .............
6.5.3. Correctness and Other Properties of the
SynthesisAlgorithm
..........................
Refinements of the Synthesis Algorithm. .........
6.5.4.
Avoidable Attributes .................................
Boyce-Codd Normal Form ............................
6.7.1. Problems with Boyce-Codd Normal Form ........
Exercises ...........................................
Bibliography and Comments ..........................

7. MULTIVALUED
DEPENDENCIES,
7.1.
7.2.
7.3.
7.4.

7.5.
7.6.
7.7.
7.8.
7.9.
7.10.
7.11.

DEPENDENCIES,
AND FURTHER

JOIN
NORMAL

8.3.

104
107
108
108
110
113
115
117
119
119
122

. . . . . 123

Multivalued Dependencies. ...........................


Properties of Multivalued Dependencies ................
Multivalued Dependencies and Functional
Dependencies .......................................
Inference Axioms for Multivalued Dependencies .........
7.4.1. Multivalued Dependencies Alone ...............
7.4.2. Functional and Multivalued Dependencies .......
7.4.3. Completeness of the Axioms and Computing
Implications..
...............................
Fourth Normal Form .................................
Fourth Normal Form and Enforceability of
Dependencies .......................................
Join Dependencies ...................................
Project-Join Normal Form. ............................
Embedded Join Dependencies. ........................
Exercises ...........................................
Bibliography and Comments ..........................

8. PROJECT-JOIN
MAPPINGS,
TABLEAUX,
THE CHASE .............................................
8.1.
8.2.

FORMS

ix

124
126
127
129
129
132
133
135
137
139
140
142
143
144

AND

Project-Join Mappings. ...............................


Tableaux ...........................................
8.2.1. Tableaux as Mappings ........................
8.2.2. Representing Project-Join Mappings as
Tableaux ....................................
Tableaux Equivalence and Scheme Equivalence .........

146
146
148
1.50
151
152

Contents
8.4.
8.5.

8.6.

8.7.
8.8.
8.9.
8.10.
9.

10.

Containment Mappings ..............................


Equivalence with Constraints. .........................
85.1.
F-rules ......................................
8.52.
J-rules ......................................
TheChase ..........................................
8.6.1. The Finite Church-Rosser Property .............
8.6.2. Equivalence of Tableaux under Constraints ......
8.6.3. Testing Implication of Join Dependencies ........
8.6.4. Testing Implication of Functional Dependencies . .
8.6.5. Computing a Dependency Basis ................
Tableaux as Templates ...............................
Computational Properties of the Chase Computation. .....
Exercises ...........................................
Bibliography and Comments ..........................

156
160
162
163
164
168
174
175
177
180
182
186
189
194

............................
REPRESENTATION
THEORY
9.1.
Notions of Adequate Representation. ...................
Data-Equivalence of Database Schemes ................
9.2.
Testing Adequate Representation and Equivalence
9.3.
Under Constraints ...................................
9.3.1. P Specified by Functional Dependencies Only ....
9.3.2.
P Specified by Functional and Multivalued
Dependencies ................................
9.3.3. Testing Data-Equivalence
.....................
Exercises ...........................................
9.4.
9.5.
Bibliography and Comments ..........................

195
195
208

QUERY SYSTEMS .......................................


10.1. Equivalence and Completeness ........................
10.2. Tuple Relational Calculus. ............................
10.2.1. Tuple Calculus Formulas .....................
10.2.2. Types, and Free and Bound Occurrences .......
10.2.3. Tuple Calculus Expressions ...................
10.3. Reducing Relational Algebra with Complement to Tuple
Relational Calculus ..................................
10.4. Limited Interpretation of Tuple Calculus Formulas .......
10.4.1. Reducing Relational Algebra to Tuple Calculus
with Limited Evaluation ......................
10.4.2 Safe Tuple Calculus Expressions ...............
10.5. Domain Relational Calculus ...........................
10.6. Reduction of Tuple Calculus to Domain Calculus. ........

224
225
227
229
231
236

210
211
215
217
221
223

242
244
247
247
250
255

Contents
Reduction of Domain Calculus to Relational Algebra. .....
TableauQueries .....................................
10.8.1. Single Relation Tableau Queries ...............
10.8.2. Tableau Queries for Restricted Algebraic
Expressions .................................
10.8.3. Tableau Queries that Come from Algebraic
Expressions .................................
10.8.4. Tableau Queries for Multirelation Databases ....
10.8.5. Tableau Set Queries .........................
10.9. Conjunctive Queries .................................
.........................................
10.10. Exercises..
10.11. Bibliography and Comments ..........................

10.7.
10.8.

11. QUERY
11.1.
11.2.
11.3.
11.4.

11.5.

11.6.
11.7.

11.8.
11.9.

MODIFICATION

Levels of Information in Query Modification .............


Simplifications and Common Subexpressions in Algebraic
Expressions .........................................
Optimizing Algebraic Expressions. .....................
Query Decomposition ................................
...............................
11.4.1. Instantiation.
...................................
11.4.2. Iteration
11.4.3. The Query Decomposition Algorithm. ..........
Tableau Query Optimization ..........................
11 S. 1. Tableau Query Equivalence ...................
11 S.2.
Simple Tableau Queries ......................
.................
11.53.
Equivalence with Constraints
11.5.4. Extensions for Multiple-Relation Databases .....
11.5.5. Tableau Set Query Equivalence ...............
Optimizing Conjunctive Queries ... .*. ..................
Query Modification for Distributed Databases ...........
11.7.1. Semijoins. ..................................
11.7.2. Fragments of Relations .......................
Exercises ...........................................
Bibliography and Index. ..............................

12. NULL VALUES, PARTIAL


DATABASES SEMANTICS
12.1.
12.2.
12.3.
12.4.

.................................

INFORMATION
AND
................................

Nulls ...............................................
Functional Dependencies and Nulls ....................
Constraints on Nulls. .................................
Relational Algebra and Partial Relations ................

xi
257
262
262
268
272
274
276
278
278
286

287
293
295
301
307
311
313
315
323
323
327
335
339
348
350
353
3.54
3.59
361
369

371
372
377
384
386

xii

Contents

12.4.1. Possibility Functions .........................


12.4.2. Generalizing the Relational Operators ..........
12.4.3. Specific Possibility Functions ..................
Partial Information and Database Semantics. ............
12.5.1. Universal Relation Assumptions ...............
12.5.2. Placeholders and Subscheme Relations .........
12.5.3. Database Semantics and Window Functions. ....
12.5.4. A Window Function Based on Joins ............
12.5.5. WeakInstances .............................
12.56.
Independence ..............................
12.5.7. A Further Condition on Window Functions. .....
Exercises ...........................................
Bibliography and Comments ..........................

386
389
394
406
406
408
410
413
416
422
427
432
437

ACYCYLIC DATABASE SCHEMES .......................


13.1. Properties of Database Schemes .......................
13.1.1. Existence of a Full Reducer ...................
13.1.2. Equivalence of a Join Dependency to
Multivalued Dependencies. ...................
13.1.3. Unique 4NF Decomposition. ..................
13.1.4. Pairwise Consistency Implies Total
Consistency .................................
13.1.5. Small Intermediate Joins .....................
13.2. Syntactic Conditions on Database Schemes ..............
13.2.1. Acyclic Hypergraphs .........................
13.2.2. JoinTrees.. ................................
13.2.3. The Running Intersection Property ............
13.3. Equivalence of Conditions ............................
13.3.1. Graham Reduction ..........................
13.3.2. Finding Join Trees ...........................
13.3.3. The Equivalence Theorem for Acyclic Database
Schemes.. .................................
13.3.4. Conclusions ................................
13.4. Exercises ...........................................
13.5. Bibliography and Comments ..........................

439
439
439

12.5.

12.6.
12.7.
13.

14.

ASSORTED TOPICS ......................................


14.1. Logic and Data Dependencies .........................
14.1.1. The World of Two-Tuple Relations ............
14.1.2. Equivalence of Implication for Logic and
Functional Dependencies. ....................

442
443
444
445
447
447
452
455
45.5
456
4.57
460
477
478
482
485
48.5
486
488

contents xiii

14.2.

14.3.
14.4.

14.5.
14.6.
15.

14.1.3. Adding Multivalued Dependencies. ............


14.1.4. Nonextendability of Results ...................
More Data Dependencies .............................
14.2.1. Template Dependencies ......................
14.2.2. Examples and Counterexamples for Template
Dependencies ...............................
14.2.3. A Graphical Representation for Template
Dependencies ...............................
14.2.4. Testing Implication of Template
Dependencies ...............................
14.25. Generalized Functional Dependencies ..........
14.2.6. Closure of Satisfaction Classes Under
Projection ..................................
Limitations of Relational Algebra .....................
Computed Relations .................................
14.4.1. An Example ................................
14.4.2. Testing Expressions Containing Computed
Relations ...................................
Exercises ...........................................
Bibliography and Comments ..........................

RELATIONAL

15.1.
15.2.
15.3.
15.4.
15.5.
15.6.

LANGUAGES

.....................

498
500
506
516
524
527
533
533
536
542
547
550

551
556
561
568
583
591

. ... .. ... .. .... .. ... ... .. .... ... ... .... .. ... ..

593

... .. ... .. ... .. ... .. .... .. ... ... .. .... ... ... ... ... ... ..

611

BIBLIOGRAPHY
INDEX.

QUERY

ISBL ..............................................
QUEL .............................................
SQL ...............................................
QBE. ..............................................
PIQUE ............................................
Bibliography and Comments ..........................

489
492
493
494

ABOUT THE AUTHOR


David Maier received his BA degree in mathematics and computer science
from the University of Oregon in 1974 and his PhD from Princeton University in 1978. For four years he was assistant professor of computer science
with the State University of New York at Stony Brook. He is currently assistant professor of computer science at the Oregon Graduate Center.
Dr. Maiers papers on database theory have appeared in JACM, ACM Transactions on Database Systems, and the SIAM Journal of Computing.

ABOUT THE BOOK


This remarkably comprehensive new book assembles concepts and results in
relational databases theory previously scattered through journals, books,
conference proceedings, and technical memoranda in one convenient source,
and introduces pertinent new material not found elsewhere. The book is intended for a second course in databases, but is an excellent reference for
researchers in the field. The material covered includes relational algebra,
functional dependencies, multivalued and join dependencies, normal forms,
tableaux and the chase computation,
representation theory, domain and
tuple relational calculus, query modification, database semantics and null
values, acyclic database schemes, template dependencies, and computed
relations. The final chapter is a brief survey of query languages in existing
relational systems. Each chapter contains numerous examples and exercises,
along with bibliographic remarks.

ISBN

O-=ll'i89+42-0

You might also like