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
LetSQL Hacksserve 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.
Credits;About the Authors;Contributors;Acknowledgments;Preface;Why SQL Hacks?;How to Use This Book;How This Book Is Organized;Conventions;Using Code Examples;How to Contact Us;Got a Hack?;Safari Enabled;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;Dont 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;Generate Combinations;Chapter 3: Text Handling;Search for Keywords Without LIKE;Search for a String Across Columns;Solve Anagrams;Sort Your Email;Chapter 4: Date Handling;Convert Strings to Dates;Uncover Trends in Your Data;Report onl#×