SQL Hacks

There should be an image here!Andrew Cumming is a big fan of SQL; he says it’s elegant, well designed, and phenomenally useful…but it’s not always easy to use: “You can do incredibly powerful queries in just a few lines of code, but then other times you have to tie yourself in knots just to get something trivial done.” With coauthor Gordon Russell, Cumming has written SQL Hacks, a collection of 100 tips and tools to help users get more from SQL’s power and flexibility, and spend less time tying themselves in knots. “There are a handful of SQL ‘cliches’ or ‘phrases’ that I use all the time, but not everyone knows about them,” says Cumming. “They save a lot of time and once they get under your skin, you can use them without thinking about them.”

For example, “Just as you might use for (int i=0;iSQL Hacks is primarily aimed at the working programmer, but Cumming assures non-programmers that they’ll find the book useful as well. “If you’re confident using a drag-and-drop query builder to get the data you need on an ad-hoc basis, then maybe you should think about taking your skills to the next level. You can use a query builder for the simple stuff – it’s ideal – but if you’re asking complex questions of your database then sooner or later you need to get your hands dirty and write some SQL.”

The book is also for those programmers who hate SQL, the kind who reach for a loop or hash table to do anything but the simplest filtering commands. “If they took just a little time to learn a handful of tricks, they could improve their code and their productivity immensely,” says Cumming.

Equally applicable for users running Access, MySQL, SQL Server, Oracle, or PostgreSQL, SQL Hacks shows how to:

  • Wrangle data in the most efficient way possible
  • Aggregate and organize 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

“Just a tiny bit more SQL can make a huge difference in terms of efficiency and maintainability,” Cumming reminds his readers. “If you have a choice between implementing a complicated calculation in the program or in the database, many programmers will do it in the program because that’s the language they’re more comfortable with. But if you do it in the database, the chances are it will run faster. Not only that, it will live longer, too. When the next version of your application comes out, the application code may well be digital dust – but the data, the database, and your queries and views are likely to survive – to be reused over and over.”

Article Written by

  • http://www.facebook.com/profile.php?id=100000004151461 Liam James Green

    Already using Chrome. :)

  • Anonymous

    Already using chrome I still use IE because some websites for my work won’t work on anything else besides IE but I low Chrome speeds and clean UI

  • http://twitter.com/pawprint_net PawPrint.net

    Nope. will stick with Firefox – don’t like the new trend for minimalistic UI – at least with FF I can get all my tools back where they belong.

  • http://twitter.com/cnctNow Ben Anderson

    Cute but I don’t think it really tells people why they should use chrome over ie9. Tech savy folks have no problem seeing why. They need to show other people why Chrome is better and this doesn’t do that. Everyone I’ve shown Chrome has eventually used it over ie9 and in combination with Firefox.

  • Anonymous

    Their new “Dad” spot is way more effective. It actually shows a practical, comprehensive use for the browser (and other google apps) in a personal, humanistic and.. even touching way. That’s the correct approach!

  • http://profiles.google.com/nocturnal.slacker V. T. Eric Layton

    I don’t think I’ll be switching from Firefox any time soon. Chrome is OK, but it is not mature enough for me at this time. I’m very comfortable with my FF and all my extensions and addons.

  • http://profiles.google.com/bsalleman Bobbie Alleman

    They don’t need to advertise to make me switch. I’ve been using Chrome for a couple of years after reluctantly giving up Opera as my browser of choice. I’m very happy with Chrome as it does everything I want it to without having to fool around with lots of add-ons.

  • Anonymous

    The real caveat of the ad is the unreleased +1 button on the address line. It still isn’t offered on their app page. But to get back to the question why advertise on TV? Well you want to reach the people not using Chrome so you go where they may be and shove it in their face. Singing to the choir isn’t quite as effective as singing to those not already in the choir.
    I use Chrome and have for a few months now. I love not being offered all of those toolbars that shorten the visual part of the page to a sliver. The biggest shortfall of Chrome is it isn’t supported by all websites, so you still have to use IE or Firefox. But the advantages of Chrome are the ever growing extensions that fit on one line and it’s speed. It’s comparable with IE and now Firefox.
    I’m a satisfied user and hope it gains in popularity. The other browsers have good aspects to them as well, but so far I’m going to stick with Chrome.

  • http://twitter.com/stmpoodle Frank

    Google is pretty good and getting better in the web browser field. I like the new IE9 because of the fact that it’s married to the native Windows 7 OS. Although I expect Google to follow suit shortly and put out a better product all the time. That’s being optimistic and positive.

  • Anonymous

    Watch Google’s video? Post it!
    I don’t have a TV.

    BTW, Firefox is my main browser, Chrome is #2

  • http://twitter.com/bepreparedalot Kyle Mackulak

    I’ve been using chrome for several months now after giving up Safari.

  • http://www.facebook.com/people/Justin-Johnson/100002466904853 Justin Johnson

    kool

  • http://twitter.com/RodolfoPiano Rodolfo Lopez

    Really Helpful Thanks:D!