I always considered database as a storage . but never thought it can be used for querying across tables etc.
Which is a good book for sql for a developer. not just the syntax. How to write a query in different ways How internally queries are executed.etc
especially related to microsoft sql server