Learning SQL on SQL Server 2005
khorner writes "I joined a local XP User Group in May of this year. As the IT Manager of Application Development for a 90+ year old agricultural cooperative, I'm introducing the concepts of agile development and need the support. Right off the bat, we've acquired some review copies of books and I volunteered for the O'Reilly book: Learning SQL on SQL Server 2005. I have been working with various versions of Microsoft SQL Server since 1999, so I figured I could give it a go." Read the rest of Kevin's review.
Learning SQL on SQL Server 2005
author
Sikha Saha Bagui & Richard Walsh Earp
pages
325
publisher
O'Reilly
rating
4
reviewer
Kevin Horner
ISBN
0596102151
summary
The organization and inconsistencies take away from the value of the book as a whole
Historically, I've found the O'Reilly books to be great references for professional programmers. I began with David Flanagan's Javascript: The Definitive Guide -- I think it was the 3rd edition. I enjoyed them for their reference value as well as business-oriented examples. Learning SQL on SQL Server 2005 does not, in my opinion, follow the mold I have become accustomed to from O'Reilly.
Learning SQL on SQL Server 2005 covers many of the topics necessary to introduce relational databases to the beginner. It is based on the authors' university course curriculum and it is evident with the review questions including with each chapter.
The authors cover important topics at an adequate depth for its target audience; however the organization needs some work. The first six chapters flip-flop across what I consider to be logical boundaries in a discussion on database development: schema versus data. Tools are a platform dependent subject necessary to discuss implementation.
The database provided could use some refactoring to get to a more cohesive and production level design. Not to be nitpicking, but as an example, equivalent domain level attributes for example, student number, are represented across tables as different column names. This is the attention to detail that drives me nuts on the professional level.
Chapter 1 sets the tone by touching multiple concepts and incorporates a smothering of screenshots. Over the first 25 pages (half being images and query result tables) we load the demo database, modify it, select from it, and cover to the Management Studio's syntax color coding and customization. Quite a lot to start off with for a novice, all with the assumption MS SQL 2005 is installed and ready to go.
Chapter 2 jumps into simple data selection of a single table and briefly hits the new MS SQL 2005 concept of synonyms.
Chapter 3 tries to focus on the schema oriented topic of table creation but falls short when jumping over to data topics like INSERT, UPDATE and DELETE. There is good coverage of data types, but we don't cover any design concepts of why we create tables and considerations for doing so. To the authors' defense, they state this is not a book on theory, but I think some level of theory is an important aspect to learn SQL.
Chapter 4 introduces the data selection concept of table joins and to do so, introduces the schema concept of keys.
Chapter 5 provides good coverage on internal functions for strings and dates and sets the foundation for more advanced queries.
Chapter 6 takes the reader through a logical process of developing a complex query. This is a good example process of taking a simple query and developing it further to satisfy a business need. Unfortunately, we experience some more inconsistency when we develop a join query using the WHERE clause - an inefficient and undesirable method the authors' discussed in chapter 4. Again, we jump from data concepts to schemas when we hit views and temp tables.
Chapter 7 through 10 present set operations, sub queries, and aggregate functions in a progressively logical manner. It would have been nice to have this progression prior to Chapter 6 and incorporate the concepts in the query development.
Chapter 11 throws in a thin coat of an introduction to table indexes and constraints: the final jump across topics.
Overall, the book provides an introduction to SQL topics. In my opinion, the organization and inconsistencies take away from the value of the book as a whole. If SQL is your profession (or you want it to be), with a list price of $44.99, Celko's SQL for Smarties is the better investment.
You can purchase Learning SQL on SQL Server 2005 from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Historically, I've found the O'Reilly books to be great references for professional programmers. I began with David Flanagan's Javascript: The Definitive Guide -- I think it was the 3rd edition. I enjoyed them for their reference value as well as business-oriented examples. Learning SQL on SQL Server 2005 does not, in my opinion, follow the mold I have become accustomed to from O'Reilly.
Learning SQL on SQL Server 2005 covers many of the topics necessary to introduce relational databases to the beginner. It is based on the authors' university course curriculum and it is evident with the review questions including with each chapter.
The authors cover important topics at an adequate depth for its target audience; however the organization needs some work. The first six chapters flip-flop across what I consider to be logical boundaries in a discussion on database development: schema versus data. Tools are a platform dependent subject necessary to discuss implementation.
The database provided could use some refactoring to get to a more cohesive and production level design. Not to be nitpicking, but as an example, equivalent domain level attributes for example, student number, are represented across tables as different column names. This is the attention to detail that drives me nuts on the professional level.
Chapter 1 sets the tone by touching multiple concepts and incorporates a smothering of screenshots. Over the first 25 pages (half being images and query result tables) we load the demo database, modify it, select from it, and cover to the Management Studio's syntax color coding and customization. Quite a lot to start off with for a novice, all with the assumption MS SQL 2005 is installed and ready to go.
Chapter 2 jumps into simple data selection of a single table and briefly hits the new MS SQL 2005 concept of synonyms.
Chapter 3 tries to focus on the schema oriented topic of table creation but falls short when jumping over to data topics like INSERT, UPDATE and DELETE. There is good coverage of data types, but we don't cover any design concepts of why we create tables and considerations for doing so. To the authors' defense, they state this is not a book on theory, but I think some level of theory is an important aspect to learn SQL.
Chapter 4 introduces the data selection concept of table joins and to do so, introduces the schema concept of keys.
Chapter 5 provides good coverage on internal functions for strings and dates and sets the foundation for more advanced queries.
Chapter 6 takes the reader through a logical process of developing a complex query. This is a good example process of taking a simple query and developing it further to satisfy a business need. Unfortunately, we experience some more inconsistency when we develop a join query using the WHERE clause - an inefficient and undesirable method the authors' discussed in chapter 4. Again, we jump from data concepts to schemas when we hit views and temp tables.
Chapter 7 through 10 present set operations, sub queries, and aggregate functions in a progressively logical manner. It would have been nice to have this progression prior to Chapter 6 and incorporate the concepts in the query development.
Chapter 11 throws in a thin coat of an introduction to table indexes and constraints: the final jump across topics.
Overall, the book provides an introduction to SQL topics. In my opinion, the organization and inconsistencies take away from the value of the book as a whole. If SQL is your profession (or you want it to be), with a list price of $44.99, Celko's SQL for Smarties is the better investment.
You can purchase Learning SQL on SQL Server 2005 from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Desperation leads some people to do strange things.
Why does the API for the databases suck so much? I've been using ADO.net with C# .NET 2.0 on SQL 2005, and why must I use the arcane and shitty SQL language to save my web objects in a datafile? Isn't there an option somewhere between writing 25 lines of SQL code for each action for each object (either in code or in a SPROC), and managing the files myself on the local HD, which most webhosts won't allow? How about a nice simple DBObject that my other objects can inherit from, that provides a nice 'SaveAllInTable(String table)' method, that replaces the INSERT INTO VALUE for each )*(&%# variable in my object? (and other similar SQL wrapper methods...I guess I could write that, but it would be a PITA, and that's what APIs are for, anyways!) Unless there's a good C# SQL wrapper that I don't know about...the datatable and datagrid isn't useful for anything more than displaying a raw table, something that a webapp usually shouldn't do, anyways...Of course, streamreader and streamwriters aren't much better, perhaps we need a good shared file i/o api that's better than SQL?
He might not be the target audience, but how would you expect a member of the target audience to pick up technical errors in a book such as this?
If it, say, taught you how to do something in a totally non-standard way that only worked on SQL Server when the standard way worked just as well, then I'd consider that to be a pretty big failing in a book like this. But somebody just beginning with SQL wouldn't have a chance of spotting something like that.
Bogtha Bogtha Bogtha
Many different vendors make DBMS services that speak SQL.... What product is this talking about?
I've had enough abrasive sigs. Kittens are cute and fuzzy.
Someone new to the field might not know what parts were missing that really should have been included. It's always better to have someone who knows the area do the review, in conjunction, if possible, with a newbie so that they can see what information transfers well, as well as what areas are lacking.
Mod parent up! The target audience for a educational book is rarely a good reviewer of the book. The parent points out one good example. But also, what if the book contained syntatical errors? How would a 'target audience' reviewer ever know the difference.
The review does a good job of recognizing that organization is the key to a educational book. All this information is publicly available (in MS's KB, MSDN, etc). The reason you're buying this book is because the information is supposed to be presented in a easy-to-learn format.
FreeBSD: The Power to Serve!
yes but to be honest to we want something out there that uses bad form to teach beginners? they will only learn bad things and then come work with you and make you mad in the long run..
if we can flog an author into writing things right and teching off of that we save our selves the time of fixing dumb shit..
but with plenty of better books out here that don't have the obvious dumb errors it is better just not to recommend this one in hopes that the author woln't write more.
'...if only "Jumping to a Conclusion" was an event in the Olympics.'
There probably wasn't a Linux or Mac User Group around. It's either the XP User Group or WoW Anonymous.
And this is different from the numerous MySql books that get reviewed here, how exactly?
If anything SQL Server behaviour is a lot closer to that of Oracle and PostgreSQL (and possibly DB2, I don't know) than MySql can ever hope to achieve!
There are local XP user groups?
when he said this:
" have been working with various versions of Microsoft SQL Server since 1999"
Man... talk about Microsoft winning the marketing war even when the tech is 3rd rate.
Also also question the need for a book on leaning sql that is specific to that bastard version of Sybase that Microsoft sells (the real answer is that PHBs typically sign off on book buys). Sql is sql, stuff that you have to code specific to any particuloar RDBMS is not sql, or at least not standard sql. Why not teach people standard sql before giving them the nonstandard exceptions for "Microsoft SQL Server" or Oracle for that matter? Or just title the book "How to write queries for MS SQL Server 2005"?
The answer probably is that you can't fill a book with "Learning SQL", there just isn't that much to it.
-- your Web browser is Ronald Reagan
(lapses into never-ending coma)
It is a full-featured and low-overhead ORM. Go to http://www.hibernate.org and check out the NHibernate link.
Plus, there are several books avilable from, e.g., O'Reilly, Manning.
He that breaks a thing to find out what it is has left the path of wisdom.
-- J.R.R. Tolkien
I couldn't possibly disagree more...
I'm no MSFT fanboy, but SQL Server (I don't count 4.2 which was basically a direct port) makes it very easy to focus on learning basic DB design, query development, and even a little performance tuning.
With few "knobs to turn and buttons to push", the beginning DBA wannabe can do stuff without needing to know a lot of gory details.
I am by no means advocating that top-notch DBAs don't need to eventually know all the gory details, along with a bunch of theory, just that for someone new trying to understand DBs better the tool makes it fairly easy to do so.
I knock MSFT all day long for lots of reasons, but SQL Server ain't one of them...
You must have some karma to burn :)
I agree, though - I'd recommend SQL Server as a teaching tool over MySQL, Postgres, or Oracle any day, assuming price/licensing wasn't an issue.
If there's a single example of Microsoft innovation to point out it'd be LINQ.
Check it out: http://msdn.microsoft.com/data/ref/linq/
The cool thing is that the query language can be adapted to ANYTHING, even Reflection.
Mod parent up! The target audience for a educational book is rarely a good reviewer of the book. The parent points out one good example. But also, what if the book contained syntatical errors? How would a 'target audience' reviewer ever know the difference.
An expert is also rarely a good reviewer of a book, at least alone. He's great at checking the educational quality of the book, in terms of teaching "best practise", technical correctness and scope. But I've also met many such a book which fail to be a good teacher, even though it's probably theoretically correct. Experts miss that because it comes natural to them, they automatically understand it the way it's meant to be understood and think others will see it their way too. In reality it is often ambigious, poorly structured and confusing for those who lack that basis. Basicly, there are two completely separate questions:
Does it teach correctly?
Does it teach well?
Let the experts answer the former, and let the target audience answer the latter.
Live today, because you never know what tomorrow brings
...it supported ANSI standard JOIN syntax long before Oracle, for example. (And don't get me started on MySQL which is only _very_ recently following standards.)
I've worked with both, (learnt on Oracle, then worked with MS SQL, and then Oracle, and then back to MS SQL) and honestly, you can learn SQL on whatever you like and your core SQL skills will be completely transferrable between different DBMSes.
While still behind Oracle in many other ways, SQL server 2005 does boast a nicely remade user tools in Management Studio.
I took MS-SQL classes back to back earlier this year with the first one using SQL server 2003 and the 2nd one using 2005 express and the difference was night and day in ease of use.
In 2003 you had to have 2 or 3 different applications up in order to create a table, populate it with data and then view the table data. I was constantly trying to do things in the window which didn't allow that action....Plus transact SQL was like an (even more) retarded version of SQL+
With Management Express it can all be done from the main window -I just wonder why it took them 10 years to figure this out.
there are still some funky aspects of MS-SQL language itself (the GO directive for instance), but this is a great new tool.
Of course now that TOAD works on MS-SQL this may not matter much to database diehards, but I do see signs of Microsoft improving GUIs, simplifying designs and improving usability both here and in VisualStudio.
Too bad they won't be able to do the same for Vista.....
What's the speed of dark?
Everyone's going to make fun of it because it's based on a Microsoft product.
I agree, though - I'd recommend SQL Server as a teaching tool over MySQL, Postgres, or Oracle any day, assuming price/licensing wasn't an issue.
I'll disagree with that statement as far as Postgres or Oracle are concerned. While I can't speak for SQL Server 2005 (haven't used it yet), but previous versions of SQL Server required special settings for correct handling of null values and arithmetic exceptions. Because most tutorials don't mention these settings when creating a database (nor are they accessible as part of the wizards), most people don't realize they haven't set up a standards conformant database.
I feel it is more important for a teaching database to conform to the standards than just have easy to use GUI tools.
Probably true of reviewing too. At least for educational books, there are two roles - student & teacher - with different perspectives.
It's true I tell you, feller at work's next door neighbour read it in the paper.
Parent has been modded insightful? Why?
:-)
:-)
We all like to knock Microsoft periodically for it's well know shortcomings, but SQL Server is not one of them. In fact it's one of the best products Microsoft produce. I've worked with Oracle, DB2, SQL Server, MySQL, Postgres on various products over the past decade or two, often as DBA, and SQL Server is a gem.
It's a highly complient database and the SQL conforms to every standard going. In fact of all the databases I've worked on it's possibly my favourite as it can be installed on clients servers and left to it's own devices and it will continue to chug away with minimal human maintenance. Put that in your pipe and smoke it Oracle (or Postgres
I'm not a MS fanboy by any means, but SQL Server is an excellent product and to declaim otherwise just shows up your lack of experience. My guess is you've probably confusing MySQL with a RDBMS and extrapolating from there
Reviews provide information about the content of the book beyond the sequence of chapters. The above is called a Table of Contents.
sic transit gloria mundi
You're reading far more into my comment than is actually there. When I mentioned non-standard syntax, I wasn't implying that SQL Server was particularly non-standard, merely that the opportunity is there for a book like this to make a mess of teaching things.
It isn't different for MySQL books, and if somebody had posted the same comment in a MySQL book review, I'd have said the same thing.
Bogtha Bogtha Bogtha
There are some great critiques for most database vendors. Where are the UNIX clients for M$ SQL server? Why hasn't Sybase maintained DB & CTlib compatibility with MS no matter the cost? Why hasn't Sybase benchmarked on the POWER5 systems that have clobbered Oracle to prove themselves more scalable than M$ once and for all?
If you are really interested in intelligent Sybase criticism, you might read some Tom Kyte. He started out as a Sybase guy, but is now an Oracle VP.
Comment removed based on user account deletion
the describe works on MySql and Oracle, is to standard, but doesn't work on SQL Server(at least the last version) and is aliased with \d on Postgres. But.. sp_help works on SQL Sever for getting the same information which doesn't work on MySql, Postgres, and Oracle so... give some counter examples of how SQL Server is closer to Oracle and Postgres.
Or... are you talking of some other Database behavior?
I agree with you, but pricing/licensing IS not an issue. SQL Server 2005 Express is free. Limited to 1 CPU and 4 gigs databases, mind you, but if you need more than that as a teaching tool, I wanna know what the hell you're learning :)
That's Wrong... NUlls and Arthimetic items can be changed by going into the Enterprise Manager and altering the properties. No SQL needed. Maybe not a wizard, but you can do it in a GUI.
Given the bizarre additions; arbitrary constructs; and the non-ANSI (e.g. "illegal") prefetch semantics, well, whatever you end up learning it won't do you a wet-slapp of good if you eventually run up against an actual SQL environment.
[And, yes, this is a little bit of a troll. But having been given the task of trying to "port" a database designed in SQL Server and having discovered just how non-portable it was, I am a tad jaded... 8-)]
Innocent people shouldn't be forced to pay for inferior software development.
--"Code Complete" Microsoft Press
Comment removed based on user account deletion
the better you teach someone the wrong way to do something, the better they will learn it...
Nice of you promoting something requiring MySQL in a Microsoft SQL Server 2005 related article.
Do you see me going around MySQL & PHP related threads promoting ASP.NET & MSSQL? No? There is a reason for it, you know. Its because it would be unwanted and unuseful zealotry.
So... Why isn't parent mod'ed off-topic yet?
Not Buzzword 2.0 compliant. Please speak english.
Honestly, there's justified MS bashing, and clueless knee-jerk wannabe cool MS bashing, and this is the later. Any production MS SQL installation will be running on Windows Server 2003, most likely as the only major application on the system, and under those circumstances it's really pretty solid.
Nobody pretends that Windows Server is as solid or efficient as Linux, but realistically it's not the pile of crap you posture, it simply doesn't score quite as highly. For practical purposes both are quite good enough to run a service on, and overall Windows Server 2003 + MS SQL is a pretty good choice.
A few short comments.
And what do you mean with "effectively and efficiantly from any kind of box, nope, not even a windows box". A few examples would be nice.
Please show me how you intend to break into Microsoft SQL Server with a random Windows installer CD. I'm truly intruiged by this, so please provide a few examples.
You seem rather ignorant and zealous, and while I value the opinion of others, I do prefer informed opinions rather than random, uninformed drivel by someone who evidently knows one product only, and bashes everything else for not being that one product.
Not Buzzword 2.0 compliant. Please speak english.
Because it's funny?
The issue isn't allowing columns to be nulls and the like. It is to correct concatenation results using nulls, null comparisons, exceptions on arithmetic underflow/overflow, and similiar issues.
I can't check right now to see if the Enterprise Manager allows changing these settings via the GUI, but the only way I have found to do it is by directly issuing alter database commands.
The fact that these settings aren't the default is another issue.
Wait...
Did you think this was a *real* product? Yes? There's obviously a reason for that, too -- ignorance.
This site is a spoof, making light-hearted fun of Ruby on Rails, Web 2.0, et cetera. The part of the joke is that you shouldn't need any specific database in a real agile environment. Then again, jokes that are over-explained wind up being less funny.
I'm more of a Postgres guy, anyway, and I think PHP is the spawn of the devil. If you're interested in understanding, do a quick comparison of the following sites, and come back with a worldview that goes beyond the purview of your toolset.
When the article's second sentence indicates the author's desire for help with agile development, my post is considered FUNNY .
Definately agree with that, both opinions would be the most useful. /.)?
But if you have to choose one over the other, which would you rather have (remember it will be published on
I would rather take the experienced user over the student in most cases. The OP seems to see things differently.
FreeBSD: The Power to Serve!
I like it. Send me a copy of "Fragile Web Development with SQL on Rails" and I'll get another review up. I'll share it with the Windows XP user group when I'm done. Removing the VC from MVC. Fantastic. A totally new and eXtreme Pattern you need to get the GoF to look at.