Sumário Itens Encontrados: 173Preface to the First Edition xiChapter 1 Setting the Scene 1The relational model is much misunderstood 1Some remarks on terminology 2Principles not products 4A review of the original model 5Model vs. implementation 12Properties of relations 14Base vs. derived relations 18Relations vs. relvars 19Values vs. variables 21Concluding remarks 22Exercises 23Chapter 2 Types and Domains 25Types and relations 25Equality comparisons 26Data value atomicity 31Whatâs a type? 34Scalar vs. nonscalar types 37Scalar types in SQL 39Type checking and coercion in SQL 40Collations in SQL 42Row and table types in SQL 43Concluding remarks 45Exercises 46Chapter 3 Tuples and Relations, Rows and Tables 49Whatâs a tuple? 49Rows in SQL 53Whatâs a relation? 55Relations and their bodies 57Relations are n-dimensional 58Relational comparisons 58TABLE_DUM and TABLE_DEE 59Tables in SQL 60Column naming in SQL 62Concluding remarks 64Exercises 64Chapter 4 No Duplicates, No Nulls 67Whatâs wrong with duplicates? 67Duplicates: further issues 72Avoiding duplicates in SQL 72Whatâs wrong with nulls? 74Avoiding nulls in SQL 77A remark on outer join 79Concluding remarks 80Exercises 80Chapter 5 Base Relvars, Base Tables 85Updating is set level 86Relational assignment 88More on candidate keys 92More on foreign keys 94Relvars and predicates 97Relations vs. types 99Exercises 101Chapter 6 SQL and Relational Algebra I: The Original Operators 105Some preliminaries 105More on closure 108Restriction 110Projection 111Join 112Union, intersection, and difference 116Which operators are primitive? 119Formulating expressions one step at a time 119What do relational expressions mean? 121Evaluating SQL table expressions 122Expression transformation 123The reliance on attribute names 125Exercises 127Chapter 7 SQL and Relational Algebra II: Additional Operators 131Exclusive union 131Semijoin and semidifference 132Extend 133Image relations 135Divide 138Aggregate operators 139Image relations bis 144Summarization 146Summarization bis 150Group, ungroup, and relation valued attributes 152âWhat ifâ queries 157A note on recursion 159What about ORDER BY? 163Exercises 164Chapter 8 SQL and Constraints 169Type constraints 169Type constraints in SQL 173Database constraints 174Database constraints in SQL 178Transactions 180Why database constraint checking must be immediate 180But doesnât some checking have to be deferred? 182Constraints and predicates 185Miscellaneous issues 186Exercises 188Chapter 9 SQL and Views 193Views are relvars 194Views and predicates 197Retrieval operations 198Views and constraints 199Update operations 203What are views for? 211Views and snapshots 212Exercises 213Chapter 10 SQL and Logic 215Why do we need logic? 216Simple and compound propositions 217Simple and compound predicates 222Quantification 223Relational calculus 227More on quantification 234Some equivalences 241Concluding remarks 244Exercises 244Chapter 11 Using Logic to Formulate SQL Expressions 247Some transformation laws 247Example 1: Logical implication 250Example 2: Universal quantification 251Example 3: Implication and universal quantification 252Example 4: Correlated subqueries 254Example 5: Naming subexpressions 255Example 6: More on naming subexpressions 258Example 7: Dealing with ambiguity 259Example 8: Using COUNT 261Example 9: Join queries 262Example 10: UNIQUE quantification 263Example 11: ALL or ANY comparisons 265Example 12: GROUP BY and HAVING 269Exercises 270Chapter 12 Miscellaneous SQL Topics 273SELECT * 273Explicit tables 274Name qualification 274Range variables 275Subqueries 277âPossibly nondeterministicâ expressions 280Empty sets 281A simplified BNF grammar 281Exercises 285Appendix A The Relational Model 287The relational model vs. others 288The significance of theory 291The relational model defined 293Database variables 298Objectives of the relational model 299Some database principles 300What remains to be done? 301Appendix B SQL Departures from the Relational Model 305Appendix C A Relational Approach to Missing Information 307Vertical decomposition 308Horizontal decomposition 309What do the shaded entries mean? 311Constraints 313Queries 314More on predicates 317Exercises 320Appendix D A Tutorial D Grammar 321Appendix E Summary of Recommendations 325Appendix F Answers to Exercises 329Chapter 1 329Chapter 2 335Chapter 3 341Chapter 4 346Chapter 5 352Chapter 6 358Chapter 7 366Chapter 8 379Chapter 9 389Chapter 10 395Chapter 11 403Chapter 12 405Appendix C 407Appendix G Suggestions for Further Reading 409Index 419