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...
Algorithms and Data Structures:
http://www.amazon.ca/Introduction-Algorithms-Thomas-H-Cormen...
http://www.amazon.ca/Algorithms-4th-Robert-Sedgewick/dp/0321...
Computer Architecture and Operating Systems:
http://www.amazon.ca/Computer-Architecture-Quantitative-John...
http://www.amazon.ca/Design-Implementation-FreeBSD-Operating...
Mathematics:
http://www.amazon.ca/Calculus-James-Stewart/dp/0495011606
http://www.amazon.ca/Introductory-Statistics-Prem-S-Mann/dp/...
http://www.amazon.ca/Introduction-Mathematical-Cryptography-...
Networking and Systems:
http://www.amazon.ca/Computer-Networks-5th-Andrew-Tanenbaum/...
http://www.amazon.ca/Database-Management-Systems-Raghu-Ramak...
http://www.amazon.ca/Distributed-Systems-Principles-Andrew-T...