Posts

General: Merry Christmas to all my readers

General: Merry Christmas to all my readers

2025 has been a busy and challenging year for me. I want to thank all of you who have been reading my blog. Every week, there are more views than before. I’m pleased to see that, even when I’ve been posting daily.

Whatever your belief system, Christmas is a moment of pause for many of us, but it’s also a reminder of how much data shapes the world around us — even in the stories we grew up with.

2025-12-25

SQL: The most frequently misunderstood query plan operators

SQL: The most frequently misunderstood query plan operators

Execution plans are one of the most valuable tools in SQL Server for understanding how a query is executed. But even experienced developers and DBAs regularly misinterpret certain operators. Some of these operators look deceptively simple, others have subtle side effects, and a few behave differently depending on cardinality estimates or memory availability.

This post walks through the execution plan operators that are most frequently misunderstood, what they actually mean, and how to interpret them correctly.

2025-12-24

Writing SQL Queries for Oracle Course Released

Writing SQL Queries for Oracle Course Released

More SQL love !

Creating reports, analytics, or applications? And need to get data out of Oracle? Learn to write SQL queries like a pro !

We have very popular SQL courses, for T-SQL, PostgreSQL, Snowflake, and MySQL. We’ve just added our new course Writing SQL Queries for Oracle and you can enrol in it now. It’s already low cost but even better, if you use the coupon code HNY2026 at checkout before 5th January, you can take advantage of our Happy New Year 25% discount as well.

2025-12-23

SQL: Parallel Programming In TSQL: Is It In Our Future?

SQL: Parallel Programming In TSQL: Is It In Our Future?

Upcoming processors are likely to have even more cores than now. Have you ever tried to write multiprocessor-style code? A friend of mine recently said that he learned some of this style of coding but later when he came back to it, he realised how much he thought he knew but didn’t.

For languages like T-SQL, we don’t have inherent support for multi-threading. In fact, the only trace I can see of this in T-SQL today is the ability to have multiple readers on a service broker queue.

2025-12-22

SQL Interview: 99 Table join order

SQL Interview: 99 Table join order

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Development Level: Medium

Question:

You are writing a query that involves inner joins across five tables. Does the order of the tables within the query affect the query plan?

Answer:

No. SQL Server determines the best order for you to join the tables in.

2025-12-21

SQL Interview: 115 Database information in master

SQL Interview: 115 Database information in master

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Advanced

Question:

Most information about each database is stored within the database.

Can you list three types of database information that live in the master database?

Answer:

Pick three of the following:

  • Database IDs, names, creation date
  • Compatibility level
  • Collation
  • Recovery model
  • Status (ONLINE, RESTORING, SUSPECT)
  • File locations and size metadata (from sys.master_files)
  • Ownership (database owner)
  • Availability Group membership
  • Replication information
  • Database GUIDs, resource IDs

2025-12-20

SQL Interview: 98 Reading tables in non-clustered index order

SQL Interview: 98 Reading tables in non-clustered index order

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Development Level: Medium

Question:

If you are SELECTing from a table and the ORDER BY clause in your query is in the same order as a non-clustered index, will the non-clustered index be used?

Answer:

It might or it might not.

2025-12-19

Book Review: DAX for Humans

Book Review: DAX for Humans

I recently received a review copy of DAX for Humans: The No CALCULATE Guide that Makes DAX Easy by Greg Deckler from my friends at PackT.

Author

Greg Deckler is the vice president of a global consulting services company. He’s a fellow Data Platform MVP and an active data community member. Greg also wrote DAX Cookbook: Over 120 recipes to enhance your business with analytics, reporting, and business intelligence .

Content

If you’ve worked with Power BI or semantic data models for any length of time, you’ve probably encountered the same challenge millions of others have: DAX is powerful… but it often feels unnecessarily difficult to learn. Much of that frustration stems from the traditional teaching approach, which centers heavily on the CALCULATE function — arguably the most complicated and unintuitive function in the entire language.

2025-12-18

SQL Interview: 97 Performance of well-formatted and laid-out SQL code

SQL Interview: 97 Performance of well-formatted and laid-out SQL code

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Development Level: Intro

Question:

A developer in your team has suggested that better formatted and laid-out SQL code will perform better?

Is this true?

Answer:

Because the optimiser reduces queries down to a format that it can work with the format of your code doesn’t make a difference. Better formatted code is more readable and maintainable though, so it’s always a good idea.

2025-12-17

SQL: Stop using db_datareader and db_datawriter

SQL: Stop using db_datareader and db_datawriter

SQL Server has a number of built-in database roles. The ones I see used the most are db_datareader and db_datawriter. They let you either read from all tables or read and write from all of them. Curiously, what has never been supplied is a db_procexecutor.

Developers and administrators who set up the use of these permissions think they are at least not using dbo or sa and while that’s true,

2025-12-16