What is the best book to learn performant SQL querying? I recently needed to query a large database for exploratory purposes. The database has historical data about many years of sales transactions of a huge company. It is using partitioning keys. I know pretty well how to write queries to get what I want but given the size of the database I need to write them performantly. How can I learn that best?