Nov 15 2007

Head First SQL (Book Review)

Posted by Steve Farwell at 4:08 PM
17 comments
- Categories: Book Reviews

Head First SQL

SQL is one of the basic tools that every web developer needs in his or her tool box. If you are a developer that learned HTML and picked up ColdFusion as the natural step into dynamic web development, SQL may have been new to you. So you learned  how to grab sets of data with "select * from artists" and maybe fine tuned it with "where artist_id = 3". Soon you found that you could loop through the data set using CFOUTPUT or CFLOOP and conditionally displayed information or reformatted the data using CFIF or a number of ColdFusion functions. Continuing to explore ColdFusion's cool tags and functions you start creating arrays, structures, queries of queries and even dabble with CFSCRIPT, ColdFusion Components and user defined functions. This is all so cool....but your pages are dead slow and your code looks like all-you-can-eat night at Ye Olde Spaghetti Factory. At this point you remember hearing that you should let SQL do what it does best, manipulate data, and let ColdFusion do what it does best, present data.

That's Head First SQL comes in. It will take you from the basics of SQL that you learned from a ColdFusion developer's book to a point where you can separate out just about all of the data manipulation and let ColdFusion display that nicely crafted data set. Head First SQL assumes you have no SQL knowledge so you can rush through the first couple chapters being careful to catch a few tips and tidbits as flip through those pages. The first couple chapters will cover things to consider in table creations and how to get data into and out of the table. The book does a nice job of covering SELECT enhancements using the qualifiers like BETWEEN, LIKE, IN, IS NULL to help you bring back just the data you need.


One of the most important concepts in database design is normalization. Normalization is organizing your database so that you have a minimal amount of redundant data. A simple example is having a table of customer information with a unique ID assigned to each customer and only that ID is stored with each order from that customer. This reduces the amount of data stored and also improves accuracy and maintenance as a change of address would mean one customer record change rather than changing many order changes. Head First SQL covers this well and of course does it in a fun fashion, come on the chapter is titled "Why be normal?". Primary keys and foreign keys, the data that relates one tables data to another, are clearly explained and emphasized.

After expanding our minds into good database design with normalization, they need to do some mind expansion to help us get that data back out. Withmultiple related tables we need to do JOINS, INNER JOINS, and OUTER JOINS to pull it all back together. There is also a concept of sub queries which helps us get our minds around bringing back a data set by first bringing back a general data set and querying that again to get a presentable data set.

The book has a nice set of extras at the end and overall it presents a critical topic for web developers in a fun way. If SQL is something you may need to see some documentation or a few examples to get the concept or get through a step in a project, this book might not be the best reference manual for you. If SQL or other areas are hard for you to get your head around, the Head First Series is definitely worth your consideration. And hey, it's O'Reilly so you won't feel like A Complete Idiot or a For Dummies kind of person when you are having some fun learning. Once you get through this book you can look to O'Reilly for books to learn about SWITCH/CASE, triggers, stored procedures, and all the stuff you need to know to keep your DBA in line.

  • Publisher: O'Reilly Media, Inc. (September 1, 2007)
  • Language: English
  • ISBN-10: 0596526849
  • http://www.oreilly.com/catalog/9780596526849/
  • Tom Barr


     

    Comments

    dinoYT

    dinoYT wrote on 05/15/09 12:08 AM

    To me the benefit for us CFML developers is in the greater adoption (and the attendant increase in numbers of developers using the language) that Railo and OpenBD can bring to CFML as a language and community. For Adobe — http://rapid4me.com/?q=Adobe, I think the profit lies in Bolt (or whatever it will be called). Assuming a greater number of CF users (sites, developers, etc.), the need for a standard IDE increases (no knock on CFEclipse...I love and use it daily). I, personally, think this is where Adobe sees the dollars (see the opening of Flex as a server versus the incredible sales of Flex Builder since version 2 as a model).
    Thomas

    Thomas wrote on 06/07/09 5:02 AM

    Give please. By the time I'd grown up, I naturally supposed that I'd be grown up. Help me! Can not find sites on the: Turbo tax. I found only this - <a href="http://turbo-tax.biz">turbo tax</a>. Second generation anti histamine have less of a sleep effect. Cobalis corporation otc-clsc a pharmaceutical and nutraceutical biotechnology company specializing in the development of anti allergy. With respect :cool:, Thomas from Malaysia.
    Noya

    Noya wrote on 06/14/09 3:18 AM

    Hi guys. Where facts are few, experts are many.
    I am from Armenia and also now am reading in English, give please true I wrote the following sentence: "Full length lesbian movies! Pictures of sma."

    THX :-), Noya.
    debt settlement companies

    debt settlement companies wrote on 09/02/09 11:42 PM

    nice post


    regards
    mack
    cushions for patio furniture

    cushions for patio furniture wrote on 09/03/09 12:52 AM

    nice post


    regards
    sam
    seattle child custody lawyer

    seattle child custody lawyer wrote on 09/03/09 1:27 AM

    nice post


    regards
    sam
    how to pass a hair drug test

    how to pass a hair drug test wrote on 09/03/09 2:57 AM

    nice post


    regards
    sam
    San antonio luxury condo

    San antonio luxury condo wrote on 09/03/09 3:28 AM

    good post

    regards
    jack
    foundation repair dallas

    foundation repair dallas wrote on 09/03/09 4:07 AM

    nice post


    regards
    mack
    bluetooth marketing software

    bluetooth marketing software wrote on 09/03/09 5:04 AM

    nice post


    regards
    mack
    Laurinda

    Laurinda wrote on 09/23/09 12:28 AM

    Could you help me. History is more or less bunk.
    I am from Monaco and also now am reading in English, give please true I wrote the following sentence: "Murakami won the draft team."

    Regards :( Laurinda.
    Austin condos

    Austin condos wrote on 10/30/09 4:30 AM

    i have posted your blog on my site
    <a href=resume" src="http://www.gravatar.com/avatar.php?gravatar_id=d662fe42a0f4cfbdb853c3779d3d25c3&rating=R&size=40&default=http%3A%2F%2Fwww%2Eoccfug%2Eorg%2Fblog%2Fskins%2FOrange%2Fassets%2Fimages%2Fnogravatar%2Epng" title="resume" width="40" height="40" class="floatLeft" />

    resume wrote on 12/24/09 9:37 AM

    wonder what other sql tricks you would bring)
    rapid4me

    rapid4me wrote on 01/26/10 2:04 AM

    I really appreciate the work you do for filling the site with good content, pleasant design and good friendly attitude to your readers! Keep on going and good luck!
    Ricarda

    Ricarda wrote on 02/23/10 10:20 AM

    Sorry. Equal opportunity means everyone will have a fair chance at being incompetent. Help me! Looking for sites on: Does tenormin cause hair loss. I found only this - <a href="http://buchhandlung.mycontent.org/Members/Tenormin">buy tenormin</a>. Tenormin, prevacid is a benefit of improvement when we know ever goodness of the cash. Tenormin, you may permanently out be original to consider your cmt average in fungal lungs and however lower the use of glass that you base. Best regards :mad:, Ricarda from Zealand.
    replica watches

    replica watches wrote on 03/11/10 1:43 AM

    thanks for the share
    real estate Buenos Aires

    real estate Buenos Aires wrote on 03/14/10 7:47 AM

    You always made your post very reading friendly to all of us! See you soon.

    Write your comment



    (it will not be displayed)