Overview

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...

See more details below
SQL Hacks

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$13.49
BN.com price
(Save 43%)$23.99 List Price

Overview

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.

This new book in the critically acclaimed "Hacks" series provides 100 unique tips and tools that push the limits of traditional SQL, from fun things like solving crosswords with SQL to complex data manipulation.

Read More Show Less

Product Details

  • ISBN-13: 9780596551421
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 2/9/2009
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 1
  • Pages: 412
  • Sales rank: 481,791
  • File size: 4 MB

Meet the Author

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.

Read More Show Less

Table of Contents

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;
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;
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 on Any Date Criteria;
Generate Quarterly Reports;
Second Tuesday of the Month;
Chapter 5: Number Crunching;
Multiply Across a Result Set;
Keep a Running Total;
Include the Rows Your JOIN Forgot;
Identify Overlapping Ranges;
Avoid Dividing by Zero;
Other Ways to COUNT;
Calculate the Maximum of Two Fields;
Disaggregate a COUNT;
Cope with Rounding Errors;
Get Values and Subtotals in One Shot;
Calculate the Median;
Tally Results into a Chart;
Calculate the Distance Between GPS Locations;
Reconcile Invoices and Remittances;
Find Transposition Errors;
Apply a Progressive Tax;
Calculate Rank;
Chapter 6: Online Applications;
Copy Web Pages into a Table;
Present Data Graphically Using SVG;
Add Navigation Features to Web Applications;
Tunnel into MySQL from Microsoft Access;
Process Web Server Logs;
Store Images in a Database;
Exploit an SQL Injection Vulnerability;
Prevent an SQL Injection Attack;
Chapter 7: Organizing Data;
Keep Track of Infrequently Changing Values;
Combine Tables Containing Different Data;
Display Rows As Columns;
Display Columns As Rows;
Clean Inconsistent Records;
Denormalize Your Tables;
Import Someone Else’s Data;
Play Matchmaker;
Generate Unique Sequential Numbers;
Chapter 8: Storing Small Amounts of Data;
Store Parameters in the Database;
Define Personalized Parameters;
Create a List of Personalized Parameters;
Set Security Based on Rows;
Issue Queries Without Using a Table;
Generate Rows Without Tables;
Chapter 9: Locking and Performance;
Determine Your Isolation Level;
Use Pessimistic Locking;
Use Optimistic Locking;
Lock Implicitly Within Transactions;
Cope with Unexpected Redo;
Execute Functions in the Database;
Combine Your Queries;
Extract Lots of Rows;
Extract a Subset of the Results;
Mix File and Database Storage;
Compare and Synchronize Tables;
Minimize Bandwidth in One-to-Many Joins;
Compress to Avoid LOBs;
Chapter 10: Reporting;
Fill in Missing Values in a Pivot Table;
Break It Down by Range;
Identify Updates Uniquely;
Play Six Degrees of Kevin Bacon;
Build Decision Tables;
Generate Sequential or Missing Data;
Find the Top n in Each Group;
Store Comma-Delimited Lists in a Column;
Traverse a Simple Tree;
Set Up Queuing in the Database;
Generate a Calendar;
Test Two Values from a Subquery;
Choose Any Three of Five;
Chapter 11: Users and Administration;
Implement Application-Level Accounts;
Export and Import Table Definitions;
Deploy Applications;
Auto-Create Database Users;
Create Users and Administrators;
Issue Automatic Updates;
Create an Audit Trail;
Chapter 12: Wider Access;
Sharing Data Across the Internet;
Allow an Anonymous Account;
Find and Stop Long-Running Queries;
Don’t Run Out of Disk Space;
Run SQL from a Web Page;
Colophon;
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)