The Office

I'm a big fan of The Office (and I won't apologize for liking the American series better); I loved Office Space and News Radio. I was even a fan of 9 to 5 as a kid. They're all classic comedy, sure – but you knew this was coming – there's an awful lot of truth to them.  I've worked for bosses sporting near comedic egos, complacency, and density. I interned with a Ryan clone, and Samir and Michael could be any of a dozen developers at four different gigs. I've never worked with anyone quite as funny as Jim, but fair is fair – he has a team of writers behind him. 

As much as I like offices, there are of course downsides.  I think one of the biggest disadvantages, for me, is the paranoia.  You really never know what others are thinking, and I've found more often than not if you're paranoid, you're right, and if you're not, you're oblivious.  (Or is that the paranoia talking?)  I've had close friends complain to the boss over little nothings, had job climates change in the blink of an eye.  The worst case I've seen personally is of a guy Sean worked with – let's call him Betty! – for a year.  When it came down to a layoff where either Sean or Betty was going to get the axe, Betty fabricated a misdeed with Sean's name on it, and got him fired.  That's a good piece of work there, Betty.

I'm not jaded, I'm really not.  And I haven't had any bad experiences in the last three or so offices I've been in (in fact I very much like the current gig, and my stint at MS).  I'm just saying that for me, that little worry is an irritating presence in the workplace.  It's strange, too, because I've been in the industry long enough to understand that, as much as you may love a job / office / environment, it's still just a job.  Even in this economy, if this one evaporates, another one waits.

So, to sum up: offices are funny. And you should be paranoid. But not really, because life is a cookie.

-Jen McCown, http://www.midnightdba.com

There was that one time we thought we poisoned our sexist boss, and we hid him in the trunk, and, well, it was all wacky hijinks…

Free Stuff (Fri?)Day!

Douglas Adams once wrote, "Time is an illusion. Lunchtime doubly so."  I must add that Fridays are like a long lunch, and must be very much an illusion.  Therefore, today is Free Stuff Day!  (I shall then go on to prove that black is white, and get myself killed at the next zebra crossing.)

  • Free geekfest for Bostonians: The Boston Book Festival on 10/24 is free, and "a must for lit+tech geeks" (thanks, @amcafee). See Tech Futures at the Boston Book Festival
  • Free cake!!  The Cake Wrecks "World Tour" will be in Dallas THIS SATURDAY (OMG OMG OMG OMG OMG I'm so excited, seriously).  For some serious fun, check out the website, then show up at this or a future tour date.
  • Free Anti-Malware: Microsoft’s New Tool in the Fight Against Malware Free to Consumers  "Microsoft Security Essentials, Microsoft Corp.’s new no-cost, core anti-malware service that helps protect consumers against viruses, spyware and other malicious software, will be available tomorrow, Tuesday, Sept. 29."
  • Free free training list (you read that right) by Brent Ozar.  Among the many offerings are:
    • 10/1 The Hidden Treasures of SQL Server
    • 10/9 Quest Day with the Experts in Aliso Viejo, CA
    • 10/21-22 Quest Connect Virtual Conference

Happy days, all!

-Jen McCown, http://www.MidnightDBA.com

Review: Inside MS SQL Server 2008: T-SQL Querying

It’s day two of Banned Book Week / the MidnightDBA book review party, and we're digging into one HEAVY SQL tome: Inside Microsoft SQL Server 2008: T-SQL Querying, by Itzik Ben-Gan, with Lubor Kollar, Dejan Sarka, Steve Kass, and Kalen Delaney.

I’m a big fan of Itzik Ben-Gan’s 2005 book of the same name, so I’ve been waiting for this updated version since slightly after I heard they were going to call the new SQL Server “Katmai”.

The bottom line, right here at the top, is that this is an absolute gold mine for T-SQL developers, both as a study guide and as a mark-it, underline-it, dogear-it reference. The book is aimed at experienced developers, but if you’re just starting out, get it anyway, along with the T-SQL Fundamentals book. (As of this writing, both books are on sale new at Amazon.com for $31.49, an excellent bargain on the usually $49.99 books.) 

Let’s take a quick trip round the chapters, shall we?

Chapter 1 discusses logical query processing, which is not necessarily the same as the physical processing.  In other words, the way the SQL engine actually processes queries is more efficient than it might seem from the logical querying. I love-love-loved this in the 2005 book, and love (x3) it here.

Chapter 2 is new: Set Theory and Predicate Logic, by Steve Kass.  As he says, “The more you understand about set theory and logic, the easier SQL will be for you.”  This chapter sets out in words the things I understood instinctively about databases and logic.  In fact, this chapter says most of the things I want to say when I talk about breaking down a SQL problem, so ignore me when I blog about this and just read the T-SQL Querying instead.Steve begins by introducing new concepts along with an example, then digs down into definitions and conventions. 

Now, I have to admit it: Set Theory was the bane of my existence in college (I failed it twice, seriously).  But I’m at the point now where I am ready to take the next step in my education, and I want this as my guide starting out.As a side note, I find a very comfortable sort of amusement, almost nostalgia, in the Mathematical Conventions discussion:

Everyone now and then in my beginning programming classes, a student – usually a good one – will name variables with an extra dose of creativity, and I’ll be confronted with something I call the penguin dialect of programming…

For(int penguin = 0; penguin < tiger-1; ++penguin) {

For(int Betty = 0; Betty < tiger-penguin-1; ++Betty) {

IF (abba[Betty+1] < abba[Betty] { …

Yes, yes, I have seen such code. 

Chapter 3 and 5 are new: respectively, The Relational Model, and Algorithms and Complexity. The relational model chapter covers basic definitions, data integrity, and normal forms, as you’d expect, but also has a great section on relational algebra and calculus. Again, these are the tools to use when we’re ferreting out the needed set of data, and Itzik presents them here clearly and concisely.  And Chapter 5 (also by Steve Kass) gives us a look into the mind of the SQL engine, including a section on sorting algorithms that somehow also take me right back to high school comp sci II.

Chapter 4, Query Tuning. This chapter, for me, is one of the (or just The) major selling points of the book. At 150 pages – enough for a book in its own right – chapter 4 is the go-to reference for tuning methodology (developed by Solid Quality Mentors), tools, examples, and enlightenment.

Chapter 6, Subqueries, Table Expressions, and Ranking Functions – I can’t praise the section on subqueries highly enough.  The CTE and OVER/PARTITION BY sections are well dog-eared in my copy, too.

Chapter 7, Joins and Set Operations – Exactly what you think, only better and more in depth.  Come to think of it, that could’ve been the entire book review.This review is starting to grow a bit more than I expected – though really, you can’t review 800 pages in under 250 words – and I was amused to find that I’m trailing off right about the time the chapter play-by-play trails off in the book’s introduction.  “Chapter 1, 2, 3, 4, 5, yadda yadda yadda”, we seem to say… 

Chapter 8, Aggregating and Pivoting Data – Totally inspired the Grouping Sets video.

Chapter 9, TOP and APPLY

Chapter 10, Data Modification

Chapter 11, Querying Partitioned Tables – Totally new chapter, by Lubor Kollar, who "led the development of partitioned tables and indexes when first inroduced in the product". I love educational material written by the people who created the product…

Chapter 12, Graphs, Trees, Hierarchies, and Recursive Queries

Oh, and Appendix A is one of the coolest things I’ve seen in a tech book: A set of logic puzzles!

One final word: This is a big book, and that can be intimidating. But it shouldn’t be, and you shouldn’t try to take the book in big bites. See our video on How to Study, and you and SQL Server 2008: T-SQL Querying will live happily ever after.

 -Jen McCown, http://www.MidnightDBA.com