Send in your Unix questions today! |
See additional Unix tips and tricks
If you want to really enjoy reading a technical book or learning a new computer skill set, you just have to check out O'Reilly's "Head First" series. These books fully earn their "brain-friendly" subtitles. Chock full of humorous graphics, highly visual ways of presenting data and very effective easy-to-follow lessons, these books are a hoot and a good deal at the same time.
This year's "Head First SQL" by Lynn Beighley follows in the Head First tradition set by such masterpieces as "Head First Design Patterns", "Head First Servlets and JSP" and "Head First HTML with CSS & XHTML". While tackling a very serious technical subject, it does so with examples and text that makes it fun.
"Head First SQL" features twelve chapters. The subtitles alone give you a feel for the mildly irreverent tone of each chapter.
The SELECT Statement: Gifted data retrieval
DELETE and UPDATE: A change will do you good
Smart Table Design: Why be normal?
ALTER: Rewriting the past
Advanced SELECT: Seeing your data with new eyes
Multi-table Database Design: Outgrowing your table
Joins and Multi-table Operations: Can't we all just get along?
Subqueries: Queries within queries
Other Joins, Self Joins, and Unions: New maneuvers
Constrains, Views, and Transactions: Too many cooks spoil the database
Security: Protecting your assets
Let's hone in on one chapter -- Advanced SELECT. This chapter starts with an example of a video store with a reshelving problem. Videos may end up in any of a number of places in the store depending on who reshelves them because the database used to categorize the store's video collection has problems. More specifically, the videos may fall into more than one category, none of which mandates a particular shelf. It then walks the reader through a redesign of the database, including notes jotted along the sides of code displays, scratch pad areas in which the reader can try his own hand at crafting some code and some highly relevant thoughts in the "there are no Dumb Questions" section.
Next, the chapter tackles the issue of alphabetical order within each category, adding an "ORDER BY" clause to the slowly improving SELECT statement and then asking the reader what can be removed to make the query more powerful. And, at this point, we're still not halfway through the chapter. It continues to cover many other important attributes of the SELECT command.
Another chapter, 12, could hardly cover a more serious issue -- security, walks the reader through adding users and setting up access rights or "grants". In examples and exercises, it asks the reader to think through the access rights needed by each user and to understand how these rights are granted with the SQL GRANT command. It explains many variations on the GRANT command as well as REVOKE commands for removing privileges given in error or no longer needed. It also discusses the problems associated with shared accounts and how to use roles to best manage user accounts.
Jammed with exercises, thoughtful questions, cartoons and side comments that make you giggle while making an important point, this book provides the most enjoyable way to learn SQL than I can imagine -- well, short of learning it pool side in the Bahamas anyway. It even includes crossword puzzles to help the reader quiz himself on what he's learned. If you want to have a fun time learning SQL, this is the way to do it. It gets down to hardcore SQL and keeps you thinking not just about what you're doing, but why you're doing it with its lively examples. This is gain without the pain. This is a fun way to learn.