Learning SQL on SQL Server 2005 142
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.
You poor soul. (Score:5, Funny)
Desperation leads some people to do strange things.
Re:You poor soul. (Score:2)
Re:You poor soul. (Score:2)
Re:You poor soul. (Score:2)
I went to an interview a few months ago and the place told me, "We tried XP but we like scrumm better because XP's cycle times are too short." A statement I found incredible because they clearly had missed the entire point of a methodology in t
Re:You poor soul. (Score:2)
Indeed, he meant Extreme Programming. I know, because I'm the one who receives and distributes the books for the group (and if anyone is in the Columbia, MO area, the mailing list is here [yahoo.com]).
And for the poster who thinks XP is just a buzzword - I'm at Agile 2006 [agile2006.com] right now with over 1100 people from companies ranging from Microsoft, Mozilla and Progressive Insurance to Shure (the microphone people), Seagate and lots of overseas companies. XP [xprogramming.org] is alive and well (if arguably poorly named) and in a lot more plac
SQL...? agile...? YES! (Score:1, Offtopic)
I think he's in desperate need of this:
SQL on Rails [sqlonrails.org]
Re:SQL...? agile...? YES! (Score:2)
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?
Re:SQL...? agile...? YES! (Score:2)
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
Re:You poor soul. (Score:1)
Re:You poor soul. (Score:2)
that's what I thought (Score:4, Insightful)
" 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.
Re:that's what I thought (Score:2)
The thing is, if someone learns one variety of SQL, they're going to be able to
Re:that's what I thought (Score:2)
If you learn one dia
Re:You poor soul. (Score:2, Funny)
Re:You poor soul. (Score:1)
You _CANNOT_ learn SQL with M$ SQL SERVER (Score:2)
[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-)]
SQL apis suck. (Score:2, Interesting)
Re:SQL apis suck. (Score:1)
personally I don't generally like prepacked stuff at that level, since most complex systems aren't just simple CRUD operations.
But if that's all you need it's pretty much out of the box.
Re:SQL apis suck. (Score:1)
Re:SQL apis suck. (Score:5, Informative)
Re:SQL apis suck. (Score:1)
Re:SQL apis suck. (Score:1)
Re:SQL apis suck. (Score:2)
Re:SQL apis suck. (Score:2)
Re:SQL apis suck. (Score:2)
For the
You get support for 12 databases and get to write code like this without having to write config files or xml definitions.
Employees emps = new Employees();
if(emps.LoadByPrimaryKey(42))
{
emps.LastName = "Just Got Married";
emps.Save();
}
Employees em
Re:SQL apis suck. (Score:1)
Re:SQL apis suck. (Score:1, Informative)
Re:SQL apis suck. (Score:3, Informative)
Because you are retrieving the data from an SQL Database?
As others have pointed out, there are many ways to do this. Another method that may work for you, depending on your situation, is the server's XML capabilities, eg. "SELECT ... FOR XML ..." will convert your dataset to XML that you can easily serialize.
Re:SQL apis suck. (Score:5, Funny)
Ah, good. I've been waiting for a long time for somebody to relieve me from the mind-boggling complexity of inner joins, subselects, triggers, referential integrity rules and stored procedures by adding DOM, XSLT, XPath, DTD and XmlSchema on top of inner joins, subselects, triggers, referential integrity rules and stored procedures.
Re:SQL apis suck. (Score:3, Informative)
Re:SQL apis suck. (Score:1)
Re:SQL apis suck. (Score:2)
From looking at the descriptions it seems like a typical MS project. Too complicated for it's own good, trying to produce a tool that will solve every problem known to mankind.
BTW if you know anybody on this team could you please urge them write real error messages? I work with SQL server every day and I curse the team every time I g
Re: (Score:2)
Re:SQL apis suck. (Score:2)
Re:SQL apis suck. (Score:2)
Re:SQL apis suck. (Score:2)
Re:SQL apis suck. (Score:1)
Re:SQL apis suck. (Score:2)
They are? And what exactly are the strongly type dataset with TableAdapers in ADO.NET 2.0? Smells like ORM stuff to me.
Re:SQL apis suck. (Score:2)
Re:SQL apis suck. (Score:1)
Re:SQL apis suck. (Score:2)
Go check out OPENXML in the BOL. SQL Server allows you to send an XML string, shred it, store it in temp tables and in the end process it into the database without having to write multiple insert statements. You can move up and down the XML tree storing multiple transactions and additional datapoints as needed for instance an order and all its associated items as one XML string sent to SQL Server which then processes it. Since I do not come from the programming side of the tracks (DBA / SQL programm
Re:SQL apis suck. (Score:2)
To be honest, I don't think using any of SQL Servers XML-features will make anyone's life any simpler, at least not in 99% of the cases.
T-SQL is a language designed for set-based operations, not fine detail-level data-shredding. Yes, it can be done. No, it doesn't look pretty.
Try NHibernate (Score:1)
Plus, there are several books avilable from, e.g., O'Reilly [oreilly.com], Manning [manning.com].
Re:SQL apis suck. (Score:2)
I think Microsoft is correct, as stated in another post, that ORM is inherently flawed. It may be the best thing we have, but shoe-horning database data into classes and vice versa is problematic. The time it takes to mess with Java's XML mappin
Re:SQL apis suck. (Score:2, Interesting)
Re:SQL apis suck. (Score:2)
That what ORM classes do.... ActiveRecord works great in RoR.
Re:SQL apis suck. (Score:2)
The 'obvious' solution is to write this code once for your object
LINQ to the rescue (Score:2)
Check it out: http://msdn.microsoft.com/data/ref/linq/ [microsoft.com]
The cool thing is that the query language can be adapted to ANYTHING, even Reflection.
Re:SQL apis suck. (Score:5, Interesting)
The beginnings of SQL date back to the 1970s, and even in modern times it shows. People hadn't yet figured out how to deal with "NULL"s in any reasonable manner, and SQL has the dumbest NULL in any language I know of that is still in common use. People still thought empty lists were something exceptional, so "SomethingID IN ()" is an error, at least in the DBs I use, instead of a clause so obviously false the optimizer ought to positively jump for joy when it sees it. The syntax is fruity and unforgiving by modern standards, and the actual relational stuff that is supposed to underlie it all continues to be masked by the performance limitations in place in the 1970s; performance hacks now enshrined as the One Right Way to do things.
SQL sucks, because so much effort has been invested into it that no possible fix to it could ever get traction, and SQL is so wrong that trying to bend your new system to be backwards compatible with it will probably break your new system. The only hope we have is a brand new paradigm, and frankly those haven't been faring too well either, so far. But hope springs eternal.
Someday this mess will be resolved, but your guess is as good as mine as to which direction it's going to come from. SQL-the-language sucks, but it still manages to set the bar pretty high for any sort of technology to replace it, even just as a language-switchout on an existing DB server. (I mean something actually not SQL, not SQL adapted to Yet Another Procedure Language or SQL adapted with Yet Another Proprietary Extension.)
Re:SQL apis suck. (Score:1)
As you say...SQL is now my canonical example of a "Good Enough" technology, which holds back any sort of improvement because there's no fast and easy way to make something immediately obviously better,
Re:SQL apis suck. (Score:1)
Re:SQL apis suck. (Score:1)
Re:SQL apis suck. (Score:2)
The trouble with it is generic code of that nature doesn't scale especially well. To make it scale, you lose the reflection, which pushed you right back to 25-lines of SQL to a model.
Personally, I'd rather save that time during initial development and then re-visit it later in the production
Re:SQL apis suck. (Score:2, Interesting)
- You musn't, get one of the half-dozen ORM's people have built for you. Some are even *gasp* open source. *Shhhhhh, don't tell anyone.
"the datatable and datagrid isn't useful for anything more than displaying a raw table, something that a webapp usually shouldn't do, anyways"
- Um... a brochure-ware web site doesn't usually, but a web app??!? I'm thinking... a table showing shopping cart items, a table showi
Re:SQL apis suck. (Score:1)
Re:SQL apis suck. (Score:2)
The Entity Framework in ADO.Net 3.0 combined with Language INtegrated query (Linq) C# language extensions is going to change how you write data based applications. Dispite my obvious bias this is one of the coolest things I've seen in quite a while.
LINQ and ADO.NET Entities: Video Podcast
http://channel9.msdn.com/Showpost.aspx?postid=202 1 38 [msdn.com]
Whitepaper:
http://msdn.microsoft.com/vstudio/default.aspx?pul l=/library/en-us/dnvs05/html/nxtgenda [microsoft.com]
Re:SQL apis suck. (Score:1)
Well, almighty you, you may have identified a need there. So, tell you what, instead of getting on your bitch-wagon, sit down, write a new access layer, and make it easier for folks.
I've noted that 2005 contains a number of solutions that 3rd party's developed to ease the way on 2000.
VS2005 contains a lot of ideas that 3rd party's came up with, and were paid handsomely for. An aquaintence made a bundle when MS bought him off. He's a self-employed consultant now.
...I'm sorry, did that sound good? Or, was
Re: (Score:1)
Re:SQL apis suck. (Score:2)
How about a nice simple DBObject that my other objects can inherit from
In SQL Server 2005 you can use .NET classes as datatypes in the DB, and then just pump your objects directly into the DB. Not that I would ever recommend it though. But it can be done.
Or you could, as others have suggested, use strongly typed datasets. If you are writing lots of manual queries in C# when using ADO.NET, you are probably doing something wrong.
What vendor? (Score:2, Funny)
Re:What vendor? (Score:5, Funny)
I'm not sure, but the few dozen or so references to "SQL Server 2005" makes me believe it's talking about SQL Server 2005.
I could be wrong though.
Wow (Score:1, Troll)
Re:Wow (Score:1)
First in a series (Score:5, Funny)
(lapses into never-ending coma)
Re:First in a series (Score:1)
Ahhhhhhh, you seem a perfect candidate for our Mission to Alpha Centauri Project.
Allow me to show you the technical details of our MTSOTBD (Monkeys Throwing Shit Out The Back Drive).
KFG
Re:First in a series (Score:2)
MS may be fairly knocked for much, nae most, of their offerings, but SQL Server is a gem. I know it must have been tempting to do the standard MS knocking, but frankly in this case all you do is show yourself up as an utter eejit.
Re:First in a series (Score:2)
Maybe you should ask the russians [prometeus.nsc.ru] about that.
Re:First in a series (Score:2)
In practise I don't think procedural SQL standards are too much of an issue as if you are design
Re:First in a series (Score:1)
Re:First in a series (Score:2)
You're too humble. And this is too funny.
My contributions:
SQL server 2005 tools much improved (Score:3, Interesting)
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?
Re:SQL server 2005 tools much improved (Score:1, Informative)
I've tried TOAD, and honestly it is not worth nearly the amount they charge ($470 per seat or $3445 for their server suite).
Re:SQL server 2005 tools much improved (Score:2, Informative)
Perhaps you're talking about Visual Studio.NET 2003?
"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."
With the MS SQL Server Enterprise Manager (comes with MS SQL Server 2000 - it's part of the client tools on the install CD), you can perform almost any action on the server - from creating databases, tables, views, users, through to all the scheduling, full-text index setup, et
Re:SQL server 2005 tools much improved (Score:1)
It makes help and maintaining a db (to a point) fairly painless, and helps to flatten the learning curve"
Couldn't agree more. Any non-moron programmer or IT person can do even "complex" tasks with almost no learning curve thanks to enterprise manager. It is the one thing that that makes sql server better than another of it's competitors. They got enterprise manager "right" from the start and is probably a BIG reason for
Re:SQL server 2005 tools much improved (Score:2)
Re:SQL server 2005 tools much improved (Score:4, Insightful)
There is no SQL Server 2003. There is SQL Server 2000.
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.
Learn SQL and use Query Analyzer (QA). Seriously, most SQL Server admin and management should be done in QA.
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+
s/retarded/standards compliant/
not a review (Score:3, Funny)
Re:How Qualified? (Score:4, Insightful)
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.
Re:How Qualified? (Score:2)
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
Re:How Qualified? (Score:2)
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 go
Re:How Qualified? (Score:1)
Probably true of reviewing too. At least for educational books, there are two roles - student & teacher - with different perspectives.
Re:How Qualified? (Score:1)
Re:How Qualified? (Score:2)
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.
Re:How Qualified? (Score:4, Insightful)
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!
Re:How Qualified? (Score:1)
Re:How Qualified? (Score:2)
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.
Re:How Qualified? (Score:2)
Or... are you talking of some other Database behavior?
Re:How Qualified? (Score:2)
Re:Slashdot wants to know (Score:2)
Re:Learning SQL on MS SQL is like... (Score:3, Insightful)
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
Re:Learning SQL on MS SQL is like... (Score:2)
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.
Re:Learning SQL on MS SQL is like... (Score:1)
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 acc
Re:Learning SQL on MS SQL is like... (Score:1)
Re:Learning SQL on MS SQL is like... (Score:1)
MS SQL is actually pretty good standards-wise (Score:2)
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.
Re:Learning SQL on MS SQL is like... (Score:3, Interesting)
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
Re:Learning SQL on MS SQL is like... (Score:2)
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
Critique more intelligently, please. (Score:2)
T
A few short comments (Score:2)
A few short comments.
And what do you mean wi
Re:A few short comments (Score:2)