
Designed for an introductory database course, this text emphasises conceptual and physical database design and tuning. It also covers advanced topics that may be useful for further study.
https://www.amazon.co.uk/Database-Management-Systems-Raghu-R...
http://www.amazon.com/Database-Management-Systems-3rd-Editio...
for Oses http://williamstallings.com/OS/OS6e.html
cheers
In the example you gave you shouldn't have problems if you put the right index on the table.
What really causes the opacity is either (a) the complexity of the query or (b) the guy writing the clearly doesn't know how to write declarative code, so he tries to write eg procedural code in SQL, with cursors and triggers and other horrors.
If you are in scenario (a) and you really do need to do something complex, I'd pick SQL over VB to do it in any day - the non-declarative style leads to huge code with side effects are more opportunities for bugs to creep in.
If you are in scenario (b), the guy writing the queries really needs to read this: http://www.amazon.com/Database-Management-Systems-Raghu-Rama...
The canonical undergrad textbook is "Database Management Systems" by Ramakrishnan and Gehrke. I've often been confused by papers we read and gone to this book for a foundation before jumping back into the paper. There are a _lot_ of chapters I haven't read (namely the first few on ER diagrams, etc.), but the chapters on storage/indexing/query evaluation/transaction management/normalization are good if you read them a few times.
The graduate-level book is called "The Red Book" (http://redbook.cs.berkeley.edu/), and is a great source of foundational papers in the field. You can find most of the papers online, but the introduction gives you a good sense for the history and evolution of databases.
I hope this helps!