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 ...

Get SQL and Relational Theory, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.