Book description
SQL is full of difficulties and traps for the unwary. You can avoid them if you understand relational theory, but only if you know how to put the theory into practice. In this insightful book, author C.J. Date explains relational theory in depth, and demonstrates through numerous examples and exercises how you can apply it directly to your use of SQL.
This second edition includes new material on recursive queries, “missing information” without nulls, new update operators, and topics such as aggregate operators, grouping and ungrouping, and view updating. If you have a modesttoadvanced background in SQL, you’ll learn how to deal with a host of common SQL dilemmas.
 Why is proper column naming so important?
 Nulls in your database are causing you to get wrong answers. Why? What can you do about it?
 Is it possible to write an SQL query to find employees who have never been in the same department for more than six months at a time?
 SQL supports “quantified comparisons,” but they’re better avoided. Why? How do you avoid them?
 Constraints are crucially important, but most SQL products don’t support them properly. What can you do to resolve this situation?
Database theory and practice have evolved since the relational model was developed more than 40 years ago. SQL and Relational Theory draws on decades of research to present the most uptodate treatment of SQL available.
C.J. Date has a stature that is unique within the database industry. A prolific writer well known for the bestselling textbook An Introduction to Database Systems (AddisonWesley), he has an exceptionally clear style when writing about complex principles and theory.
Publisher resources
Table of contents
 SQL and Relational Theory
 Dedication
 Preface to the First Edition
 Preface to the Second Edition
 1. Setting the Scene
 2. Types and Domains
 3. Tuples and Relations, Rows and Tables
 4. No Duplicates, No Nulls
 5. Base Relvars, Base Tables

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
 7. SQL and Relational Algebra II : Additional Operators
 8. SQL and Constraints
 9. SQL and Views
 10. SQL and Logic

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
 12. Miscellaneous SQL Topics
 A. The Relational Model
 B. SQL Departures from the Relational Model
 C. A Relational Approach to Missing Information
 D. A Tutorial D Grammar
 E. Summary of Recommendations
 F. Answers to Exercises
 G. Suggestions for Further Reading
 Index
 About the Author
 Copyright
Product information
 Title: SQL and Relational Theory, 2nd Edition
 Author(s):
 Release date: December 2011
 Publisher(s): O'Reilly Media, Inc.
 ISBN: 9781449316402
You might also like
book
HandsOn Machine Learning with ScikitLearn, Keras, and TensorFlow, 2nd Edition
Through a series of recent breakthroughs, deep learning has boosted the entire field of machine learning. …
book
Designing DataIntensive Applications
Data is at the center of many challenges in system design today. Difficult issues need to …
book
Fundamentals of Software Architecture
Salary surveys worldwide regularly place software architect in the top 10 best jobs, yet no real …
book
Head First Design Patterns, 2nd Edition
You know you don’t want to reinvent the wheel, so you look to design patterns—the lessons …