Press "Enter" to skip to content

Category: Learning

Creativity, Learning from Code, and the APPLY Operator

Rob Farley covers one of my favorite operators:

SQL Server 2005 was released, of course, in 2006, and I had been running the Adelaide SQL Server User Group since September 2005. Information about the new features had been coming through, and I’d been at TechEd Australia 2005 – my first since 1999. I was still an application developer at the time (well, a manager, but still getting my hands dirty), but saw the data as the most important part of my applications. When the T-SQL enhancements in SQL Server 2005 came through, there were two things that caught my eye (I know they were available in Oracle before SQL Server, but I was focusing more on the Microsoft platform by then). They were the OVER clause, and APPLY.

This is all part of a broader story about reading code to learn from it.

Comments closed

String Casing in Snowflake

Kevin Wilkie is on the case:

When you’re working with a database, it’s very hard to not deal with strings at some point in your journey. There are lots of different functions that you will be working with when you’re working with strings. Today, I want to go over some of the basic ones that you’ll use in Snowflake.

The first two that you’ll deal with make the string either upper or lowercase. Yes, that’s right – you’ve probably figured out the names of the functions already. UPPER() and LOWER() are the 2 functions respectively.

Kevin mentions title capitalization (though not by name) and the quick rule depends on which rulebook you’re using. I grew up with MLA, which I summarize as:

  • Don’t capitalize articles (the, a, an), prepositions, or coordinating conjunctions (for, and, nor, but, or, yet, so)
  • Don’t capitalize “to” when it’s an infinitive (to go, to drive, etc.)
  • Don’t capitalize the second part of a hyphenated phrase if it shows up in the dictionary as one word without a hyphen
  • Capitalize everything else

And a quick bit of advice: understanding title capitalization really does make you look more professional, I promise. Unless we’re using different rulebooks, in which case at least one of us is a heretic.

Comments closed

Context and Auditors

Martin Schoombee shares a learning experience:

When you’re young and inexperienced you may have the determination to succeed (read: youthful exuberance), but the lack of experience (or understanding of the context) may get you in a lot of trouble because you may see something as black or white when in reality it’s a shade of grey.

This story is how my inexperience (almost) got me into a whole heap of trouble, and how it defined the rest of my career.

Read on for Martin’s story. Some advice I received early in my career is, give the auditors exactly what they ask for, no more and no less. Don’t assume they have detailed technical expertise—some do, but many don’t. And don’t assume they have the full story—they have what you’re saying and (typically) a built-in assumption that you’re soft-shoeing them.

Comments closed

The Cost and Difficulty Level of Changes

Richard Swinbank has an image for us:

I spent some time working at a property portal, where users could look at online listings of homes for sale or rent, then go on to book a viewing appointment with an estate agent. On one occasion we were asked to build a Power BI report showing:

  • the number of appointments booked by portal users
  • the percentage of appointments where the user had viewed the online listing more than once.

Sounds easy enough, right?

Click through for the image. It makes intuitive sense, but is a good visual depiction of why some data requests are more challenging than others.

Comments closed

Code Is a Liability

Nate McMaster (indirectly) talks dollars and cents:

Early in my software engineering career, a senior engineer at Microsoft told me “the best solution is one that requires no new code.” At the time, I thought this was nonsense. Is not my role as a software engineer to write code? Why would writing less or no code be better? More code means more bug fixes, more features, more services, and more tools. So why is more not always better?

Fast forward to 2023 – now I am the most senior engineer on a team, and I give the same guidance. Prefer solutions that require less or no code.

What led to this shift in perspective? 

Read on for Nate’s answer, which is well-written and makes a lot of sense. It’s also close to a topic I’ve written about in the past.

Comments closed

Managing a Technical Project

Jeff Mlakar has some advice:

Over the years, in various positions, I’ve participated in many projects as a developer, lead developer, architect, jack-of-all-trades administrator, etc. I’ve also had the opportunity to lead technical projects as well.

This post focuses on techniques I have employed to successfully manage technical projects. Read on for tips regarding meetingscommunication, and building your confidence.

Read on for Jeff’s tips and recommendations.

Comments closed

Being a Better DBA with the SPIN Model

Eitan Blumin takes us to a seminar:

The SPIN sales strategy is a selling technique that was developed by Neil Rackham in the 1980s. SPIN is an acronym that stands for SituationProblemImplication, and Need-payoff. This strategy is based on the idea that asking the right questions can help you understand your customer’s needs and provide the best solution for them.

When I first heard about the SPIN sales strategy, I was attending a lecture that was delivered to us by a sales and marketing specialist during one of our company meetings several years ago. As a DBA, I initially assumed this strategy wouldn’t be relevant to my job. But as I listened to the presenter explain the SPIN model, I began to see its potential for use in my daily work:

It’s an interesting approach and I like the way Eitan ties it back to database administration. Of course, we could tie it to application development or any of a number of other fields. I, meanwhile, use the Colombo method, in which I ask a series of seemingly-dumb questions, but just before I leave, I say “Oh, just one more question,” and hit the person with the question proving I know that person committed the crime and have enough evidence to make an arrest.

Comments closed

Tips for People Moving to Postgres

Ryan Booz shares a few bits of advice about people learning about Postgres:

I was much further in my SQL Server career than I should have been before I understood the usefulness of APPLY in T-SQL. I didn’t realize that APPLY isn’t a SQL standard and so when I started using PostgreSQL and needed similar functionality, I was perplexed trying to find the equivalent. Fortunately, I wasn’t the only one searching.

My recollection here is that Microsoft introduced the APPLY operator before there was an ANSI standard, so as long as my memory isn’t faulty here, this wasn’t a case of a vendor just deciding to name something differently for the sake of it.

Regardless, Ryan has a lot of good advice for learners of PL/SQL.

Comments closed

Understanding the Fold Function

Prakhar takes us through the fold function in functional programming, using Scala as the language of choice:

“fold” is a common operation in programming languages including Scala where we essentially use it to “reduce” (note that “reduce” is also an operation in programming languages and has a special meaning in Scala as well). In this blog, we will learn how to use the fold function, understand different types of fold operations (including foldLeft and foldRight), and try to understand how it all works. Although fold operation can be applied on Option, Future, Try, etc.. but here we will understand it through List

Fold is extremely useful for things like “I want to calculate a sum but it’s got to be a conditional sum” or when you have more complex mathematical operations to combine elements together. It can take a while to get comfortable with the syntax, but once you do, it opens mental doors.

Comments closed

The Most Common SQL Server Engine Errors Generating Support Tickets

Joseph Pilov collects a list:

About 6 months ago we decided to look at what SQL Server engine error messages are most commonly generating support cases to Microsoft. The end goal was to update the documentation for those error messages to allow our customers to find answers for themselves before they have to call Microsoft for technical assistance.

The task, as we suspected from previous experience, was not easy because we had to mine cases for error numbers and a relatively small number of support cases get reported with error messages when they are opened. Please report full error messages when you open support cases with Microsoft – it would help us get you answers faster. Still, we were able to find the trends even from the small percentages because were looking for the top 20 or so most common errors, based on case count, and we needed relative information – which error is reported more than another.

Click through for the list. A benefit from going through this exercise is that Microsoft has provided more information on each of those error IDs, hopefully making it easier for people to diagnose and resolve problems without needing to reach out to support.

Comments closed