Slashdot Mirror


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.

6 of 142 comments (clear)

  1. Re:SQL apis suck. by Anonymous Coward · · Score: 1, Informative

    Check out object relational mappers. nHibernate (.NET version of Java's Hibernate) comes to mind.

  2. Re:SQL apis suck. by CastrTroy · · Score: 4, Informative

    It's called a database abstraction layer. You have to build your own objects that support saving themselves to the database. It's not as much work as it sounds like, and will actually save you a lot of trouble in the long run.

    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  3. Re:SQL apis suck. by Kunta+Kinte · · Score: 2, Informative

    ...why must I use the arcane and shitty SQL language to save my web objects in a datafile?

    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.

    --
    Based on upvotes, Ageism is the only "-ism" Slashdotters care about and think isn't SJW
  4. Re:SQL apis suck. by killjoe · · Score: 2, Informative

    Microsoft is philosophically opposed to ORM layers. That's why they have never provided one with ODBC, ADO, DMO, .NET or whatever TLA they ever came out with. MS believes that you should use stored procs for pretty much everything. For example when they re-did petshop they loaded the entire thing with stored procs because it provided faster performance.

    --
    evil is as evil does
  5. Re:SQL server 2005 tools much improved by Anonymous Coward · · Score: 1, Informative

    "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"

    I've tried TOAD, and honestly it is not worth nearly the amount they charge ($470 per seat or $3445 for their server suite).

  6. Re:SQL server 2005 tools much improved by spec8472 · · Score: 2, Informative

    First of all - there was no SQL Server 2003.
    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, etc etc.

    If you need to perform particularly complex tasks (executing a pre-prepared, or complex query) that can't be done in the GUI - the Query Analyser is two clicks away from the main Enterprise Manager window (Tools -> Query Analyser)

    "Plus transact SQL was like an (even more) retarded version of SQL+"

    That's pretty much a matter of opinion - I find T-SQL very easy to use and learn. Help and reference material is one F1 key away, and if that doesn't do it - Googling on MSDN is usually the best source of examples and references.

    My experiences with using PL/SQL under Oracle have been less than ideal - on several occasions I've had to stop using Oracle and switch to an MS SQL / MySQL environment, simply because I was spending far too much time trying to get the DB up and running. I suppose if I had several months and a good reference on hand -- that might all be different, but there's not an easy learning curve in PL/SQL (even for someone who has a decent amount of experience with other DBMSs). YMMV.

    "Of course now that TOAD works on MS-SQL this may not matter much to database diehards,"
    I suppose if you're getting paid at the Oracle consultant level, then the licence cost for TOAD isn't going to be of any matter to you. For those of us who are either freelancing - or working for a company that isn't keen on buying more expensive bits of software, then this isn't going to help.

    The biggest advantage for SQL Server is that they ship Enterprise Manager in the box.
    It makes help and maintaining a db (to a point) fairly painless, and helps to flatten the learning curve.