SQL Fundamentals by John J. Patrick


Book Review by Peter Gulutzan
Copyright (c) 2002 by Peter Gulutzan. All rights reserved.

I look on "SQL Fundamentals" as a first college text. It's not for those who've already decided what their career specialties or vendor preferences are, so there has to be some fluid overview of what's out there, what the possibilities are, and what the state of the SQL art is. Full oft I've recommended generic texts like those by Date and Celko, as I biasedly believe beginners should look at standard SQL. John J. Patrick takes a different approach; he covers a common-denominator SQL; he knows that students will probably have lab access to Oracle or Access; the SQL that's common to Oracle and Access is his focus. That Oracle/Access focus is the distinguishing feature of "SQL Fundamentals".

Obviously one could question whether these are the right choices for DBMS examples, especially if (like me) one believes that only a few people in the real world use both those DBMSs on a regular basis. That is, although Oracle holds a third of the big-time SQL market and Access (when Office sales are included) is numero uno in the small-time SQL market on Windows machines, the intersection of the two sets is -- I'm guessing -- less than 1% of the SQL world. On the other hand, I must admit that the union of the two sets is doubtless over 50%. So if I were a college teacher, I'd think that exposing students to these particular DBMSs is a favour to them.

I'm looking at the second edition of "SQL Fundamentals" and perhaps that's why I must disagree with the picky user critiques that I've read on amazon. I read over and over that the editing and spelling is sloppy, but I don't see any major problems in that respect, so I'll assume they got fixed for this edition. However, I think Patrick missed some opportunities to update as of 2002 (the second edition's publication date). For example: his list of "Other SQL Products" (page 8) includes Beagle SQL and GNU SQL, which are both moribund. For another example, his description of "The Multiuser Environment" (page 762) talks about Oracle's Rollback Segments but not about undo tablespaces, which is what an Oracle9i manual would include.

COVERAGE. The book has all the SQL that's common to Oracle and Access. You won't find "partitions" or "stored procedures" or "XML" in the index (those matters are not common and are arguably not fundamental anyway). You will find thorough coverage of tables, the main DML statements (SELECT INSERT UPDATE DELETE), installation, joins, subqueries, constraints, and several matters that are absent from theolder books by Date or Celko. A good example of that is Patrick's coverage of sequences. They're in because (a) both Oracle and Access have some way of defining serials, (b) they're important enough nowadays that anybody who creates a serious database should be aware of them. Kudos.

METHOD. Patrick likes to set up simple exercises that students can try out online on either DBMS without much trouble (there's a CD-ROM in the back cover which might be helpful here). I have to admit that I didn't, but that's my flaw, I know too much SQL so I'd be bored by doing exercises. I must envisage my school days, and when I do I can accept that this approach would work well with someone who's motivated by, say, fear of a test. Let's put it this way: one can try to write a descriptive text e.g. a reference with a BNF+discussion like Date does, or one can try to write an anecdotal text e.g. a bestiary with a puzzle+answer like Celko does, or one can try to write an essential text e.g. a summary with a task+practice like Patrick does. Again, this means that Patrick's book will lose appeal with some part of the market, but what will you? The man must focus, and if that means eschewing the full descriptions and the "cheerful little facts about the square of the hypotenuse" (as Gilbert and Sullivan expressed it) then such things must be.

STYLE. I must fault the verbosity. (Since I and my co-author Trudy have been accused of verbosity in our own books I live in a glass house but know whereof I speak.) For example there's a whole page to explain that "Tables are tall and thin" with a diagram to help you visualize this concept -- but do you want to? Sometimes, too, the terminology is obscure. For example (page 450) there's a section titled "Counting to zero" and its initial paragraph says: "Sometimes you want zeros to appear in your result. When you want this, the way to get it is to apply the count(column) function to a column of nulls. The count(distinct column) function can also create a zero." Now, if you don't read ahead to find that COUNT() returns zero when a set is empty, surely phrases like "counting to zero" and "create a zero" would confuse you? The editor should have cut paragraphs like this entirely, and the book would be clearer as well as shorter. (By the way the book has 834 pages, which is longer than most introductory SQL texts.)

I found the book's examples were pretty easy to follow, but I notice that another review of "SQL Fundamentals" says it was hard to follow (see Ocelot's Book Reviews page for links to sample chapters and reviews of this and other books). I must end up by recommending that teachers should consider it for an introductory text, although my prejudices would make me plump for a more standards-approach text, if teaching were my problem.

Patrick, John J. SQL Fundamentals -- 2nd ed. Prentice Hall, 2002. 834 pages. Includes CD-ROM. Chapter headings: (1) Storing information in tables, (2) Getting information from a table, (3) Compound conditions in the where clause, (4) Saving your results, (5) Modifying data through a view, (6) Creating your own tables, (7) Formats, sequences, and indexes, (8) Data integrity, (9) Row functions, (10) Using row functions, (11) Summarizing data, (12) Controlling the level of summarization, (13) Inner joins, (14) Outer joins, (15) Union and union all, (16) Cross joins and self joins, (17) Combining tables in a production database, (18) If-then-else and subqueries, (19) The multiuser environment, (20) The design of SQL.



Return to Ocelot's SQL Book Reviews Page