Skip to Main Content
SQL and Relational Theory
book

SQL and Relational Theory

by C.J. Date
January 2009
Intermediate to advanced content levelIntermediate to advanced
426 pages
12h 53m
English
O'Reilly Media, Inc.
Content preview from SQL and Relational Theory

Preface

SQL is ubiquitous. But SQL is hard to use: It’s complicated, confusing, and error prone—much more so, I venture to suggest, than its apologists would have you believe. In order to have any hope of writing SQL code that you can be sure is accurate, therefore (meaning it does exactly what it’s supposed to do, no more and no less), you must follow some appropriate discipline—and it’s the thesis of this book that using SQL relationally is the discipline you need. But what does this mean? Isn’t SQL relational anyway?

Well, it’s true that SQL is the standard language for use with relational databases—but that fact in itself doesn’t make it relational. The sad truth is, SQL departs from relational theory in all too many ways; duplicate rows and nulls are two obvious examples, but they’re not the only ones. As a consequence, it gives you rope to hang yourself with, as it were. So if you don’t want to hang yourself, you need to understand relational theory (what it is and why); you need to know about SQL’s departures from that theory; and you need to know how to avoid the problems they can cause. In a word, you need to use SQL relationally. Then you can behave as if SQL truly were relational, and you can enjoy the benefits of working with what is, in effect, a truly relational system.

Now, a book like this wouldn’t be needed if everyone was using SQL relationally already—but they aren’t. On the contrary, I observe much bad practice in current SQL usage. I even observe such practice ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL Tuning

SQL Tuning

Dan Tow

Publisher Resources

ISBN: 9780596155865Errata Page