T-SQL Fundamentals (Microsoft Press)

Author: Itzik Ben-Gan
Publisher: Microsoft Press
Pages: 608
ISBN: 978-0138102104
Print: 0138102104
Kindle: B0BTLBXF8V
Audience: T-SQL developers
Rating: 5
Reviewer: Kay Ewbank

Itzik Ben-Gan is a highly respected Microsoft Data Platform MVP, and the earlier editions of this book were already very good. This edition has been updated to cover recent versions of SQL Server, including SQL Server 2022, and Azure SQL Database.

The book opens with a look at the background to T-SQL querying and programming, both the theoretical background based on set theory and predicate logic, and the practicalities of the SQL Server architecture and use of tables.

Banner

Chapter 2 introduces T-SQL through single-table queries. As with other chapters, this chapter lays out the material being introduced, then has a set of exercises and their solutions. Joins are the next topic to be introduced, specifically cross joins, inner joins, composite, non-equi and multi-joins. Outer joins are also covered, with information on including missing values, and filtering attributes from the non-preserved side of an outer join.

Subqueries are the next topic to be considered, including good explanations of the Exists predicate and the problems that you can encounter with Null.

By Chapter 5, Ben-Gan has moved on to table expressions and how to work with CTEs - common table expressions, including using column aliases and arguments. This opening part of the book concluded with a chapter on Set operators - Union, Intersect and so on.

Ben-Gan then moves on to looking at the wider topic of T-SQL for data analysis, and how to achieve this using Window functions, pivoting data, grouping sets and time series. This is followed by a chapter on data modification, with sections and exercises on the various Insert options, Delete, Truncate, Merge and Update.

A useful chapter on temporal tables follows. These are tables with two columns showing how long the row is valid for, with a linked history tables holding the older states of rows that have been modified. Next comes a strong chapter on transactions and concurrency, with a clear discussion of the different options for isolation levels.

A chapter on SQL Graph is new in this edition. SQL Graph was introduced in SQL Server 2017, and Ben-Gan explains the use of specialized node and edge tables to store the data, then goes on to look at the uses of graph modeling, and how to use it to query data.

The final chapter of the book is titled Programmable objects, and it includes discussions of variables, batches, If..Else and While, Cursors, Routines and Dynamic SQL (i.e. Exec).

I'm a fan of Ben-Gan's writing, and this updated edition of a good book reinforces this. The writing is clear, the examples and exercises are well thought out. Personally I'd have liked more on the programming aspects, but any reader of this book would end up with a good working knowledge of T-SQL.

Highly recommended.

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


GraphQL in Action (Manning)

Author: Samer Buna
Publisher: Manning
Pages: 384
ISBN: 978-1617295683
Print: 161729568X
Audience: Developers interested in GraphQL
Rating: 4.5
Reviewer: Kay Ewbank

GraphQL has achieved impressive popularity as an open-source language for APIs that can be used for querying and manipulating data.&nbs [ ... ]



Web Design, 7e (In Easy Steps)

Author: Sean McManus
Publisher: Easy Steps, 7th Ed, 2023
Pages: 228
ISBN: 978-1840789850
Print: 1840789859
Kindle: B0C24YV788
Audience:
Rating: 4
Reviewed by: Sue Gee
Web design without a designer - is it possible?


More Reviews

Related Reviews