I'm looking for a book which combines relational database theory, design and SQL techniques in a generic sense if possible. I have a feeling this is a big ask, and if that's really not available then I don't mind having perhaps two separate specialist books (one for RDBMS theory and one for SQL techniques). Any recommendations?
Relational Database Theory: A Comprehensive Introduction
Database in Depth: Relational Theory for Practitioners by O'Reilly Media
Designing Relational Database Systems
I would recommend every single book written by Joe Celko, especially Joe Celko's SQL for Smarties: Advanced SQL Programming Third Edition
I absolutely loved this online tutorial:
Database design with UML and SQL, 3rd edition
Calling it a online tutorial doesn't really do it justice. The nice thing about it is that it teaches you DB design with UML modeling integrated into the process at every step.
One complaint I have is that, if I remember from taking the tutorial, it implies that surrogate keys are generally bad. However, I've heard a lot of other people here on SO as well as the author of the DB book I am currently reading ("Pro SQL Server 2005 Database Design and Optimization") say that surrogate keys are almost always the way to go. Otherwise, you're very restricted in the changes you can make to the structure of your DB down the road.
An Introduction to Database Systems by C. J. Date for RDBMS theory.
C.J. Date's, Introduction to Database Systems, is a great formal overview of database systems, both theory and practice. His book, Database in Depth: Relational Theory for Practitioners, was already mentioned as a good resource. He has recently published an updated version of that book retitled as SQL and Relational Theory: How to Write Accurate SQL Code. Either one is good. SQL and Relational Theory is a little less formal and more pragmatic in it's approach. As the title suggests, it's aimed primarily at helping you use relational theory to write better SQL, not simply to teach you the theory.
I also like Applied Mathematics for Database Professionals by Lex de Haan and Toon Koppelaars. It goes beyond relational algebra and covers symbolic logic and set theory, including a methodology for specifying a database using symbolic logic. It takes some work to get through, but you won't regret it.
Finally, I second the recommendation to read everything Joe Celko has ever written.