Whether you're running Access, MySQL, SQL Server, Oracle, or PostgreSQL, this book will help you push the limits of traditional SQL to squeeze data effectively from your database. The book offers 100 hacks -- unique tips and tools -- that bring you the knowledge of experts who apply what they know in the real world to help you take full advantage of the expressive power of SQL. You'll find practical techniques to address complex data manipulation problems. Learn how to:
Wrangle data in the most efficient way possible
Aggregate and organize your data for meaningful and accurate reporting
Make the most of subqueries, joins, and unions
Stay on top of the performance of your queries and the server that runs them
Avoid common SQL security pitfalls, including the dreaded SQL injection attack
Let SQL Hacks serve as your toolbox for digging up and manipulating data. If you love to tinker and optimize, SQL is the perfect technology and SQL Hacks is the must-have book for you.
Chapter 1 SQL Fundamentals
Run SQL from the Command Line
Connect to SQL from a Program
Perform Conditional INSERTs
UPDATE the Database
Solve a Crossword Puzzle Using SQL
Don’t Perform the Same Calculation Over and Over
Chapter 2 Joins, Unions, and Views
Modify a Schema Without Breaking Existing Queries
Filter Rows and Columns
Filter on Indexed Columns
Convert Subqueries to JOINs
Convert Aggregate Subqueries to JOINs
Simplify Complicated Updates
Choose the Right Join Style for Your Relationships
Andrew Cumming is the Zoo Keeper at http://sqlzoo.net . He keeps a collection of tame SQL engines and presents these to the public. He cares for these beasts, protecting them from the abuse inflicted by SQL learners, and protecting SQL learners from the injuries that the wild engines can inflict. But mostly he shovels manure out the cages and hoses them down every now and then. Andrew also teaches at Napier University in Edinburgh, Scotland.
Dr. Gordon Russell is a Computing lecturer in Napier University, Scotland. He teaches databases, Linux, and networking. He also builds educational websites, concentrating on technology-driven online learning environments. These include db.grussell.org, whose claim-to-fame is its automatic checking of SQL assessments, and http://linuxzoo.net, which offers online users root free access to Linux servers. But without database technology to support these sites, even he would be lost.
I have not had that much fun with SQL queries till I started reading and experimenting with SQL Hacks.
SQL is often taken much for granted and this books helps explore different ways of approaching SQL queries. The different DBMS vendors have their unique flavor of SQL which SQL Hacks admiringly encompasses.
This book is a great reference/tutorial for readers with differing backgrounds except for the most experienced DBAs.