Description
Understanding SQL's underlying theory is the best way to guarantee that your SQL code is correct and your database schema is robust and maintainable. In SQL and Relational Theory, author C.J. Date demonstrates how you can apply relational theory directly to your use of SQL, with numerous examples and clear explanations of the reasoning behind them. Anyone with a modest to advanced background in SQL will benefit from the many insights in this book.
Full Description
Table of Contents
-
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
-
-
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
-
-
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
-
-
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
-
-
Chapter 5 Base Relvars, Base Tables
-
Data Definitions
-
Updating Is Set Level
-
Relational Assignment
-
More on Candidate Keys
-
More on Foreign Keys
-
Relvars and Predicates
-
Relations vs. Types
-
Exercises
-
-
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 a Step at a Time
-
What Do Relational Expressions Mean?
-
Evaluating SQL Table Expressions
-
Expression Transformation
-
The Reliance on Attribute Names
-
Exercises
-
-
Chapter 7 SQL and Relational Algebra II: Additional Operators
-
Semijoin and Semidifference
-
Extend
-
Image Relations
-
Divide
-
Aggregate Operators
-
Image Relations bis
-
Summarization
-
Summarization bis
-
Group and Ungroup
-
"What If" Queries
-
What About ORDER BY?
-
Exercises
-
-
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
-
-
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
-
-
Chapter 10 SQL and Logic
-
Simple and Compound Propositions
-
Simple and Compound Predicates
-
Quantification
-
Relational Calculus
-
More on Quantification
-
Some Equivalences
-
Concluding Remarks
-
Exercises
-
-
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: Join Queries
-
Example 10: UNIQUE Quantification
-
Example 11: ALL or ANY Comparisons
-
Example 12: GROUP BY and HAVING
-
Exercises
-
-
Chapter 12 Miscellaneous SQL Topics
-
SELECT *
-
Explicit Tables
-
Name Qualification
-
Range Variables
-
Subqueries
-
"Possibly Nondeterministic" Expressions
-
Empty Sets
-
A BNF Grammar for SQL Table Expressions
-
Exercises
-
-
Appendix The Relational Model
-
The Relational Model vs. Others
-
The Relational Model Defined
-
Objectives of the Relational Model
-
Some Database Principles
-
What Remains to Be Done?
-
-
Appendix Database Design Theory
-
The Place of Design Theory
-
Functional Dependencies and Boyce/Codd Normal Form
-
Join Dependencies and Fifth Normal Form
-
Two Cheers for Normalization
-
Orthogonality
-
Some Remarks on Physical Design
-
Concluding Remarks
-
Exercises
-
-
Appendix Answers to Exercises
-
Chapter 1
-
Chapter 2
-
Chapter 3
-
Chapter 4
-
Chapter 5
-
Chapter 6
-
Chapter 7
-
Chapter 8
-
Chapter 9
-
Chapter 10
-
Chapter 11
-
Chapter 12
-
-
-
Appendix Suggestions for Further Reading
-
Colophon
Product Details
- Title:
- SQL and Relational Theory
- By:
- C. J. Date
- Publisher:
- O'Reilly Media
- Formats:
-
- Ebook
- Safari Books Online
- Print Release:
- January 2009
- Ebook Release:
- January 2009
- Pages:
- 432
- Print ISBN:
- 978-0-596-52306-0
- | ISBN 10:
- 0-596-52306-8
- Ebook ISBN:
- 978-0-596-80093-2
- | ISBN 10:
- 0-596-80093-2
Customer Reviews
