The Bit Bucket

SQL Interview: 114 master database

SQL Interview: 114 master database

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:

You know that the master database in SQL Server is now separate to the resource database (mssqlsystemresource).

Can you list three types of instance-level metadata that still live in the master database?

Answer:

2025-12-27

SQL Interview: 101 Restoring successful backups

SQL Interview: 101 Restoring successful backups

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: Medium

Question:

If you have successfully created a SQL Server database backup, what could cause you to not be able to restore it, on the same server or another server ?

Answer:

A successful SQL Server backup does not guarantee that it can later be restored successfully. A few important points explain why:

2025-12-26

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