Microsoft SQL Server 2008 T-SQL Fundamentals

  • ISBN13: 9780735626010
  • Condition: NEW
  • Notes: Brand New from Publisher. No Remainder Mark.

Product Description
Master the foundations of T-SQL with the right balance of conceptual and practical content. Get hands-on guidance—including exercises and code samples—that show you how to develop code to query and modify data. You’ll gain a solid understanding of the T-SQL language and good programming practices, and learn to write more efficient and powerful queries. Discover how to: Apply T-SQL fundamentals, create tables, and define data integrity Understand logical query… More >>

Microsoft SQL Server 2008 T-SQL Fundamentals

5 thoughts on “Microsoft SQL Server 2008 T-SQL Fundamentals”

  1. Film director Stanley Kubrick would make a film in a specific genre, after which there was almost no point in making movies in that genre any more. War movie – Paths of Glory, political satire – Dr Strangelove , historical film – Spartacus, science fiction – 2001 A Space Odyssey, horror – The Shining. Itzik Ben-Gan managed to do with his book what Kubrick did with his films. There just is no point in writing another book on T-SQL after his.

    The first thing I looked for when I picked the book at the post office was the section on Outer Joins. A common question when using outer joins that is the source of lot of confusion is whether to specify a predicate in the ON or WHERE clause of the query. Itzik explains it definitively: ” You can see that with respect to rows from the preserved side of an outer join, the filter based on the ON predicate is not final. In other words, the ON predicate does not detremine whether the row will show up in the output, only whether it will be matched with rows from the other side. So when you need to express a predicate that is not final – meaning a predicate that determines which rows to match from the nonpreserved side – specify the predicate in the ON clause. When you need a filter to be applied after outer rows are produced, and you want the filter to be final, specify the predicate in the WHERE clause. ”

    If only I this book existed ten years ago I would have avoided some of the mistakes I made through the years, only because some fundamental things were never clearly explained. Itzik fills the gaps for an exprienced DBA and gives a perfect basis for a novice. The fundamentals become crystal clear so that building on top of it is easy. Perhaps this can be best illustrated by the following example:

    “Can you figure out how to write an UPDATE statement that swaps the values in col1 and col2? In most programming languages where expressions and assigments are evaluated in some order (typically left to write) , you need a temporary variable. However, because in SQL all assignments take place as if at the same point in time, the solution is very simple:

    UPDATE dbo.T1

    set col1= col2, col2 = col1;

    In both assigments the source column values used are those prior to the update, so you don’t need a temporary variable.”

    Now why did no other book I read ever give this simple example?

    Common Table Expressions are explained really well, especially updating and deleting data using CTEs. Actually, the book covers all the 2005 and 2008 related enhacements ROW_NUMBER, RANK, DENSE_RANK and NTILE, Recursive Queries, APPLY,CROSS APPLY, OUTER APPLY,EXCEPT and INTERSECT, TRY…CATCH, TOP Enhancements, PIVOT UNPIVOT, DDL Triggers, MERGE. But it covers it in such a way that nothing seems complicated. We should give it to all out C++ programmers as well.

    It was a pleasure reading the book
    Rating: 5 / 5

  2. I’m half way through this book and I am totally impressed. The author not only explains T-SQL syntax very systematically, but also explains enough of the theory behind it to help you understand why. This makes it much easier to optimize your syntax and avoid logical bugs in your code. This is not an introductory level SQL book, but it’s not a book for experts either. I have been writing SQL for years and I have learned a great deal from this book already. I highly recommend this book if you are looking to take your SQL skills from basic/intermediate to a more advanced level.
    Rating: 5 / 5

  3. I have worked with T-SQL for about 11 years, but nevertheless immediately pre-ordered this “Fundamentals” book when I saw a blog post about it – for three reasons: (a) I wanted to fill in any missing gaps in my understanding of the language, (b) I wanted to learn what was new with the 2008 offering, and (c) I have heard Itzik Ben-gan speak and read his blog for sometime and always find his presentations to be excellent. I was not disappointed.

    For me, this has been one of those rare reads, where I can see where the topic is going but it is never dull because I either learn something new about the subject or the presentation clarifies what I already knew. I especially like how the book continually reinforces how T-SQL is built on set theory and predicate logic.

    Great read and reference. I highly recommend it.

    Kudos to the author.
    Rating: 5 / 5

  4. I’m primarily a C++ and Java developer who hasn’t worked on SQL for a while. I needed a book to refresh my T-SQL but didn’t want to invest in beginners book so I tried to borrow one. This is the one I got my hands onto.

    In a pleasant surprise, the book turned out to be a lot more than a refresher. Years ago I learned SQL from books/tutorials that first list the syntax of SELECT query, with all its options, and then explain it. That approach could lead to a lot of misconceptions, such as I thought SELECT clause was processed before the GROUP BY clause. So I never understood why sometimes SQL server laughed at me. It was like I was taught how to translate from English to SQL; so my spoken SQL was more like English than native SQL.

    This book teaches you how the SQL queries are logically processed in the head of SQL server. It’s like it teaches you the grammar of SQL from the perspective of its native speaker. So ultimately you learn how to think in SQL; an essential step in mastering any language.

    On the flip side, the book has a lot of repetition of concepts. He states the concept in the beginning of the section and then in every example he repeats the whole concept. Considering the book is targeted for beginners, I’m willing to ignore it.

    I would recommend this book to beginners and struggling professionals.

    Rating: 4 / 5

  5. This book is excellent. I began reading this book with a limited knowledge of SQL picked up from basic trial and error coding. Most of the time I did not know why or how something worked, only that it did work or in many cases did not work without hours of revision. After reading this book I now have a very good understanding of how code should work and why.

    Itzik Ben-Gan is a wonderful author, who really understands how to teach a subject. Instead of just throwing code out there at you for a specific result, he often goes through it line by line letting you know exactly what each step is accomplishing. One of the greatest things about this book is the time taken to emphasize the order in which things are processed in SQL Server. This may seem trivial, but after knowing this I can honestly say 90% of the coding errors I ever suffered where due to not knowing the processing order.

    The bottom line is, I would recommend this book to anyone who is interested in knowing T-SQL.
    Rating: 5 / 5

Leave a Reply

Your email address will not be published. Required fields are marked *