The Practical SQL Handbook: Using SQL Variants (4th ed.)
The books introductory text on SQL is clear and concise. I also found its treatment of normalization to be as close to perfect as can be with one exception: It doesn't tell when you can go too far with normalization. In an introductory text this is acceptable, and perhaps wise considering what many new to relational databases consider acceptable database design.
And while the introductory chapter is great, the chapters on selects and joins is so clear and useful that I would even call it exciting. The terrific thing about this book is when you have finished reading it you should come away with a feel for how the underlying DB actually works and what it is doing to produce the data for you.
I personally found this book very useful, even though I am using MySQL for the application I'm writing. But the feature set that MySQL chooses to support will logically limit the usefulness of the this book for the MySQL user. Programmers developing for Postgres, Firebird, and others will obviously get much more out of the book and its treatments on subqueries and views than will MySQL users.
One thing that did turn me off is the inclusion of a CD-ROM. The CD has a copy of Sybase for the user to work with. I don't need to explain that the internet is a superior place to put such things. That said, at least it wasn't glued to the back cover (a pet peeve) and was instead bound into the book like a magazine reply card. Many publishers perceive that they can charge more for a book that has a CD, but I just find it annoying and wasteful. But that's hardly a reason not to buy this book and place it on your bookshelf in a prominent position, not on the bottom ghetto shelves next to the stack of paper for your printer.
In short, those looking for an book about SQL, that won't teach them bad habits would be well served by this book (and likely by its sister book, The Practical SQL Handbook: Using Structured Query Language by the same authors) and those who think they know SQL will find it a useful text to have handy as well.
You can purchase The Practical SQL Handbook: Using SQL Variants from bn.com. Slashdot welcomes readers' book reviews -- to submit yours, read the book review guidelines, then visit the submission page.
I note that this is the 4th edition - is this one of those times that the sequel is better than the original?
Tom.
Oh arse
I read an earlier edition and have a very high opinion of it. It's not an intro to database programming, but it will get you from nothing to very far into SQL.
I have the 3rd edition and was actually flipping through the 4th edition a couple of days ago at the bookstore. I honestly didn't see any big differences at all, certainly not enough to justify buying another copy.
It came as news to me, but the author is a SQL god so I guess it must be true.
Has anyone ever read the SQL for Smarties series (I think there are two)? I 've heard some good things about them and am curious what your reactions are.
Honestly, that is the most pathetic argument I've ever heard in a review - it would be more reasonable if you had said "they didn't provide a CD but made it available for download. This will be a major irritation for modem users, and there is no reason why they couldn't have shipped it with the book."
As pretty much the local DBA-by-default among the developers here, I would say that having this manual, or an earlier edition similar to it, in the hands of the average programmer is invaluable. It gives them the basics of SQL theory across the multiple databases we work with and reduces the number of SQL-related questions I have to deal with.
For DBAs and advanced SQL programmers, however, I would recommend database-specific manuals that give greater insight than an overview text such as this, as this type of manual is unavoidably poor in the more important aspects of query optimization. Jack of all trades and master of none, as the case usually is.
Decent review, BTW (+1 INTERESTING, article moderation)
The CD has a copy of Sybase for the user to work with.
A free coaster!
The opposite of progress is congress
As opposed to doing what with them?
Avantslash - View Slashdot cleanly on your mobile phone.
I'm just getting into SQL myself - at least I've got perl talking to a mysql database
During a web-search for help with SQL, I came across a discussion, which said that SQL had many limitations (I don't have the link anymore.)
I've found SQL reasonably powerful so far, but obviously I'm new to this stuff.
Can anybody point out the areas that SQL is lacking in ? (and maybe where new progress is being made.)
Just interested.
Cheers.
SQL-92 has much better syntax than SQL-89. I just wish more of it was implemented. MS SQL-Server actually does a better job of it than even Oracle. Compare
Select A.*
From A,B
Where A.MayorName is not null
and A.CityID = B.CityID
and B.TaxRate > 5
vs.
Select A.*
From A JOIN B
ON (A.CityID = B.CityID)
Where A.MayorName is not null
and B.TaxRate > 5
The major difference is that the join is explicityly removed from the filtering done in the where cluase. This makes queries much easier to read. Queries can get extreamly complex and when you have something like 6 joins you will soon appreciate the new syntax.
This book sounds interesting so I will be checking it out!
--Peter
www.cgisecurity.com/lib Has some good papers on sql security.
Believe me, if I started murdering people, there would be none of you left.
Structured Query Language
The only deadtree book I've read on SQL is:
A First Course in Database Systems (2nd Edition)
- Jeffrey D. Ullman, Jennifer D. Widom
I found that it covers almost everything I needed, with a no-nonsense approach (no "CheckPoints", long pointless blurbs, or long code listings).
Although written for the academic, it didn't stop me from reading mostly the second half of the book first (the SQL stuff), and reading some theory when I wanted to.
The SQL it covers is pretty standard stuff that works with most databases (except for MySQL at the time I read it, some ACID principles couldn't apply). The specific details for each databases can be picked up by reading online docs.
If you visit SE-asia, check out their bookstores where you can find tons of "mainland china" editions of these classics that cost a tenth of the price as the real deal.
Thanks for an excellent review, I was looking for a beginner to expert book to compliment my "from the ground up" sql book, and this may have a place on my shelf.
"On a long enough timeline, the survival rate for everyone drops to zero."
I don't want to start the "is MySQL a real RDBMS" debate again. Well, maybe. Anyway, it seems a little strange for a discussion of advanced SQL to center around MySQL. The only serious defense I've heard for MySQL is that it handles very simple queries more quickly than other engines. If you're a serious doing a database app that requires you to think about normalization, you probably need a database that's smart enough to optimize a complicated query.
SQL
/S Q L/ An industry-standard language for creating, updating and, querying relational database management systems.
/see'kw*l/), was just another unofficial name for a precursor of SQL. However, the IBM SQL Reference manual for DB2 and Craig Mullins's "DB2 Developer's Guide" say SQL _does_ stand for "Structured Query Language".
SQL was developed by IBM in the 1970s for use in System R. It is the de facto standard as well as being an ISO and ANSI standard. It is often embedded in general purpose programming languages.
The first SQL standard, in 1986, provided basic language constructs for defining and manipulating tables of data; a revision in 1989 added language extensions for referential integrity and generalised integrity constraints. Another revision in 1992 provided facilities for schema manipulation and data administration, as well as substantial enhancements for data definition and data manipulation.
Development is currently underway to enhance SQL into a computationally complete language for the definition and management of persistent, complex objects. This includes: generalisation and specialisation hierarchies, multiple inheritance, user defined data types, triggers and assertions, support for knowledge based systems, recursive query expressions, and additional data administration tools. It also includes the specification of abstract data types (ADTs), object identifiers, methods, inheritance, polymorphism, encapsulation, and all of the other facilities normally associated with object data management.
The emerging SQL3 standard is expected to be complete in 1998.
According to Allen G. Taylor, SQL does _not_ stand for "Structured Query Language". That, like "SEQUEL" (and its pronunciation
Cruise TT
SQL, being an acronym, is properly pronounced ess cue el. Mispronouning SQL as sequel shows the lack of pedantry needed to be a good computer scientist.
Also, increasing the "perceived value" of the book is porbably only part of the story. Undoubtedly AW got some kind of consideration from Sybase for advertising their product this way.
sPh
According to Daniel K. Benjamin's "Oracle 9i New Features For Administrators Exam Guide," Oralce 9i introduces:
Oracle has a lot of problems, but standards conformance is not one of them. Oracle is one of the few databases to have certified with NIST for SQL-92.
If you want to learn SQL, I suggest the following:
Get a copy of whatever database you're going to use. Microsoft SQL Server is actually really easy to configure and use and has some great graphical tools. If anyone knows of some similar graphical tools for an OSS database, please let me know.
Next, look at a database that someone else has written and attempt to manipulate the data through queries.
The best book I've actually purchased for SQL is "Transact-SQL Programming" by O'Reilly. If you are working on a Microsoft database, this book is a great companion to the built-in help system in Query Analyzer.
Amazing magic tricks
Joe Celko's SQL for Smarties
This thing covers all the basics, theory, and advanced topics I have ever asked of it. It will really take your SQL to a whole new level.
Closed source, proprietary.
Why not Postgres 7.2 for the Linux crowd, and Firebird (Open Source version of Borland's Interbase db) for the Windows crowd.
Lots of graphical tools available, and not that difficult to set up (compared to Oracle, anyway).
Both implement all features that a modern relational database are supposed to support.
Thanks for warning mr. lone gunmen.
Continuing the grand tradition of reviewing computer texts sent to us by publishers, Slashdot author chrisd has read the book The Practical SQL Handbook: Using SQL Variants and written up a review.
chrisd can read?
I am curious about what books or resources other people have used to learn SQL. I got my start in SQL using the book LAN Times guide to SQL. It was a really good book.
"...at least it wasn't glued to the back cover (a pet peeve) and was instead bound into the book like a magazine reply card."
Awwwwwwwwww, does that get your panties in a bind?
Actually, I have read this book. Don't waste your money. I have been looking for years for a SQL book that can come even close to showing me the advanced features that I am required to work with everyday. This book still does not exist. Maybe I will have to write my own.
Most of us have matched set coasters with an AOL theme.
And learning T-SQL is a good idea if you want to work for someone who uses SQL Server. (Which is a lot of people- so more power to you)
But lets say you want to run a database for yourself or you are a smaller company. Then I would not recommend worrying too much about learning a variant of SQL tied to an expensive propietary system. (SQL Server only runs on MS NT or 2000- and so you've got server licensing, db server licensing and then seat licenses for everyone who will connect to the db)
At my small company we looked at expanding a product so we priced a new server- and then SQL Server licenses for that server and 200 users. The licensing on the software was much more expensive than the hardware we wanted to buy.
Our solution? We are going w/PostgreSQL. It has some very nice visual tools for management. It has good ODBC support. And it has most of the capability that SQL Server has. Enough to justify taking advantage of the monetary savings.
And Oracle? Forget it- more expensive than SQL Server.
Granted there are businesses out there where the cost of Oracle or SQL Server is more than justified- but those huge companies are a minority of the business world. There are many more like us- not huge but we need good RDB systems.
.
It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
Man, if that could only be made to stick, it could improve slashdot discussions 1000%.
This is horrible - no sample chapter link, no table of contents...just a lot of MySQL disclaimers. That doesn't cut it. How well this book's material covers Oracle, MS SQL Server, Sybase, DB2 (and the above mentioned DBs) is important. What's in the book, stupid?
Don't pull another "Lone Gunmen" -- the book hasn't made it to this time zone yet!
Can't I put this in my .sig?
No point in me re-writing what this guy wrote.
a developer uninterested in Oracle, MS-SQL, Sybase or Informix
OK, so you're not interested in the DB of choice of 90% of the dev. population. Fine. But then it begs the question: why are you writing this review?
I think we'd all could benefit from the opinion of someone that has used at least 2 or 3 RDBMSs!
Your review reminds me of a Woody Allen quote: I took a speed reading course, then I read War and Peace. It's about Russia.
Better luck next time!
there's no place like ~
Posted by chrisd...Continuing the grand tradition of reviewing computer texts sent to us by publishers, Slashdot author chrisd has read the book The Practical SQL Handbook....
Continuing the grand tradition started by Elmo (the muppet) of speaking the 3rd person about oneself, chrisd introduces his own review this way.
Speaking in the third person can indicate mental illness, such as split-personality disorder. Imagine this scene on Sesame Street:
"Hey Elmo, how are you feeling today?"
"ELMO WANTS TO HURT PEOPLE!"
Or how about this?:
"Hey chrisd, what do you think of Nvidia's latest video card offerings?"
"CHRISD WANTS TO HURT PEOPLE!"
Watch out taco!
I admint he is the mannnnnn. check out microsoft.public.sqlserver.programming for his bits of wisdom and wit.
SQL is a different monster than procedural programming.
I did google for those. I also bothered to read the project statuses for each one. PostgreSQL-R critically lacks:
Whether they support a Master-Master configuration or not (which, you'll note, is not even mentioned on the site), it's not near finished enough to compete with Sybase et al. in this particular, but important area.
-l
Help cure AIDS, cancer, and more. Donate your unused computer time to worldcommunitygrid.org. Join Team Slashdot!
The first ime I was tasked with creating a more complex database I read a book called "Database Design for Mere Mortals" it really helped out.
1 9/ qid=1024686302/sr=8-1/ref=sr_8_1/102-8984857-99665 49
I recommend it to anyone getting into database work.
http://www.amazon.com/exec/obidos/ASIN/02016947
I do wish I had bought California real estate when it could be had for 5 figures. But I thought it was too high....
As long as you specify the tables involved, the DB engine can easily figure out the primary join paths (if you set it up right). It seems to me that is better factoring than to repeat the relationships over and over.
Only when you are doing something different or odd should the joins need to be explicitly stated, and only incrimentally. (I know some DB's already support something like this, but it should be standardized IMO.)
Then again, if we are going to change SQL, then perhaps overhaul it completely (another thread below).
Table-ized A.I.
why did some moron mod this down and give it a troll rating? he makes a perfectly good observation asking a perfectly good question.
(* Exactly. Poor design is not an excuse to blame SQL. SQL is math. Can math solve bad design? *)
But there are different ways to "math" the same thing. For example, Relativity and Quantum Physics may solve certain problems, but sometimes old fashion Newtonian physics can do it quicker, have a shorter learning curve, and be 99.99999999 percent as accurate.
If I replaced SQL, here is some draft suggestions:
http://geocities.com/tablizer/relat2.htm
My biggest complaint is that SQL is too nested-based, whereas, I would rather see it be reference-based. Graphs are more general-purpose than trees. Plus, being able to isolate the name-space into smaller chunks would be helpful IMO.
Table-ized A.I.
JOIN, CASE, NULLIF and COALESCE are all in SQL-92. SQL compliance is measured in levels. Oracle 8i met some minimum entry-level compliance, but is quite poor at implementing SQL 92 features. Oracle 9i is considerably better.
SQL Server is pretty extensive in its SQL-92. They got concatenation wrong, which seems like "embrace and extend."
Postgres is probably the best popular ANSI92 SQL engine out there right now.
I don't complain about moderation much but sometimes you can only take so much.
I would love to here from whoever moderated my post as Flamebait and have them explain some reason for that. There's nothing I said that isn't accurate and parts of it are posted all over this thread.
I guess I committed the cardinal sin of posting something that did not toe the party line. How freaking pathetic.
I like the moderation system and I like to moderate- but some times I just get pissed when some idiot who knows absolutely nothing mods someone down.
I think modding down should burn 2 points and modding someone up should burn 1. Too many people are way too free w/off topic, redundant, troll, etc.
So to the faceless, ignorant moderator of my post let me just say - You Suck.
(yeah - its friday I've got some time on my hands and I do feel better now. That's worth a little karma)
.
It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
I first learned SQL from an earlier edition of that book (Probably the third.). A coworker borrowed it and kept it when he left for another job.
If you want to learn SQL, buy that book, and don't loan it to others.
No data, no cry
He hasn't read the book and is making stuff up to get a response. The author didn't say anything like that.
Have you read "SQL for Smarties" by Joe Celko?
And for those just getting stated there is:
Instant SQL Programming - Joe Celko
As for keeping track of sql variants, I recommend Oreilly's *SQL in a nutshell*. It's helped me quite a bit developing a vendor neutral app that runs on both Oracle and SQL Server. (It covers Postgres and MySQL also).
As the reviewer posted, learning sql and learning the various flavours IMHO is too much for one book. The Nutshell book is a reference for advanced users.
MySQL, on the other hand, can rightfully be criticized for not supporting much of SQL92. But don't tar all open-source databases with the same brush...
Ahh, takes me back to the old days (1987). The first relational database I ever worked with was SEQUITUR, developed by Lee Felsenstein, the engineer who designed the breakthrough Osborne PC the first portable/lugable computer, (see http://www.obsoletecomputermuseum.org). I didn't know at the time how SEQUITUR performed its magic, but I figured out how to use it, and loved it. Felsenstein never marketed it well enough to compete with dBase or Paradox, but I think it was better than either of them. Many years later, when I took classes in MS-SQL, I began to see how it all fit together and evolved into something even more powerful.
Actually Transact SQL is not completly tied to M$ SQL Server.
You'll find it used with at least some versions of Sybase.
Remember M$ SQL Server's History (purchased from Sybase, indeed they were Paying Sybase royalties until 7 IIRC).
That being said, while I try and stick as closely to SQL89/92 as possible, I would say that TSQL with it's extentions is not nearly as much of a PITA as PL/SQL.
Bugs Bunny was right.
Virtually any interesting programming language is Turing complete. This means that it is complex enough to model a simple state engine. Since this simple state engine is able to model any known computer language, in some sense virtually all computer languages can do the same tasks. (Albeit with different amounts of ease.)
SQL very deliberately cannot do this. It has virtually no procedural capabilities, and never will. Just because you can think of a procedure to accomplish something does not mean that SQL will let you do that.
The reason for the limit is that SQL is supposed to be analyzed and optimized. Turing complete languages cannot fully be analyzed or optimized. (Search for "The Halting Problem".) SQL theoretically can be, and with a good database the way that it finds to actually carry out a query is very likely to be much better than any procedure that you would have thought of.
A classic example of a problem that SQL does not handle well is the old "bill of materials" problem. You want to build a car. You know what parts go into a car. For each part you know what parts it requires. And so on. It is fairly easy to set up your table.
Now how do you, in a single query, find all of the materials that go into building a car? You can't answer that directly. Instead you need to arrange to do a set of queries, or you need to arrange to have some auxilary tables that you carefully synchronize just to answer this question.
The same problem arises whenever you want to model a tree-like hierarchy (eg a threaded view of a discussion) in a relational database.
That answer your question?
I use both join forms with SQL Server, and have finally gotten used to the explicit form. However, the Microsoft implementation is less than perfect:
- you can't use derrived tables
- you can't group one table and then join it to another
- there are also limitations in how you can use outer joins that will occasionally force you to use the old form.
Still, I find that it can improve the maintainability of SQL - especially with careful formatting:
select member.*,
member_customer.*
from member m
left outer join member_customer mc
on mc.id = mc.id
and mc.customer_id = 1
left outer join member_supplier ms
on mc.id = ms.id
left outer join member_preferences mp
on mc.id = mp.id
where m.state = 'IL'