- Shopping Bag ( 0 items )
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. On the other hand, if you're not well versed in the theory, you can fall into several traps. 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, you'll learn how to deal with common ...
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. On the other hand, if you're not well versed in the theory, you can fall into several traps. 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, you'll learn how to deal with common SQL dilemmas, such as:
Database theory and practice have evolved since Edgar Codd originally defined the relational model back in 1969. Independent of any SQL products, SQL and Relational Theory draws on decades of research to present the most up-to-date treatment of the material available anywhere. Anyone with a modest to advanced background in SQL will benefit from the many insights in this book.
Chapter 1: Setting the Scene
Chapter 2: Types and Domains
Chapter 3: Tuples and Relations, Rows and Tables
Chapter 4: No Duplicates, No Nulls
Chapter 5: Base Relvars, Base Tables
Chapter 6: SQL and Relational Algebra I: The Original Operators
Chapter 7: SQL and Relational Algebra II: Additional Operators
Chapter 8: SQL and Constraints
Chapter 9: SQL and Views
Chapter 10: SQL and Logic
Chapter 11: Using Logic to Formulate SQL Expressions
Chapter 12: Miscellaneous SQL Topics
The Relational Model
Database Design Theory
Answers to Exercises
Suggestions for Further Reading
Posted September 13, 2010
To start, this book is about theory and is not for anyone looking for a specific vendor implementation. Just trying to get through the first few chapter is tough because it's (just as the rest of the book) very dry and full of theory. There isn't much practicality in this book that you can apply to the real world but it does give you a way to think about what is going on behind the SQL scenes - or does it? Since each vendor has their own interpretations and implementations, I'm not so sure how this book can help structure better SQL statements in practice.
Since this book is nothing more than a history lesson with insightful explanations and examples, I would only recommend it for the academics. The book itself is not all bad however; I enjoyed chapter 4, "No duplicates, no nulls". The truth tables presented really give an idea of what potential bugs you might run into while dealing with comparisons.
To sum it up, this might as well be a textbook.
Posted April 14, 2010
First, disclaimer: this book is not for everyone. If you are beginner in database programming and SQL, there are plenty of other books to read. This book is more for seasoned software developers with years of practice in the field, who, like me, never really worked on database level before. There are some facts left forgotten since university years that can really make the difference on how do you see your task. Quoting from the book - 'Logical difference is a big difference'. If you want to refresh your knowledge of the theory behind the SQL, this book is for you.
Author covers surprising amount of area in just a 400-page book (this count includes answers to all exercises, by the way). Author starts with basics - types, domains, tuples and relations - and immediately shows how these abstracts relate to their SQL counterparts. After you learned why nulls are bad (but sometimes necessary) and why you shouldn't use row ids in your SQL code, we gradually get to the power of formal logic behind relational algebra - and again, there's a comparison on how it looks like in SQL.
What I really liked in author's style is that he is not afraid to repeat important things until they really settle in your head. For eternally multitasking people this is a huge bonus.
The culmination of the book is the chapter 'Using logic to formulate SQL expressions'. While short, this chapter is really important and I recommend reading it several times and doing all included exercises. Again, it's not about coding, it's about proper thinking. If you know strength and weaknesses of SQL compared to relational theory, you can apply you skills more effectively.
And the last dish is an appendix B, 'Database design theory'. If you forgot why the table(s) should be normalized (and HOW they should be normalized), this is a good text to refresh your knowledge.
As I told earlier, this book is not for everyone. You should already know SQL (not all of it, but at least the basics) and have some database experience behind you. Remember, designing bad database is frustratingly easy. Read this book, get better.
Posted October 12, 2009
SQL and Relational Theory How to Write Accurate SQL Code
C.J. Date / O'REILLY
This is the best SQL book I have read so far! I have read many SQL books but this one beats every single one of them. This book is about how you can apply relational theory directly to your use of SQL. My favorite chapter was chapter 1 it teaches SQL terminology. It talks about The Relational Model, Principles, Structural Features and many more. Another good chapter is chapter 11 where it shows how to formulate logic. This book is great if you want to learn SQL and its logic, I have read this book twice. After using SQL Server for many years this book opened up my eyes to some of the struggles I have come across, I have learned to use SQL logic wisely. I am ready to go out into the real world I felt I was trapped inside a box and there was no other way to do things in sql, I thought my way was the best way. But after reading and talking with some people I realized I am not the only one using sql there are many ways of writing sql to do the same thing but better performance and now that I met a few sql people I felt small because they are way smarter than me when it comes to sql. I recommend this book!
Posted August 26, 2011
No text was provided for this review.