Installing the Netflix Sample Database in SQL Server

The Netflix sample database is a sample database that can be used for learning and practicing SQL. It uses data from the Netflix Engagement Report and the Netflix Global Top 10 weekly list.

This guide covers the installation process and gets you running queries quickly. For more background on what this database is and why it’s useful for learning, see my introduction to the Netflix sample database.

Read more

Fix Error 3234 “Logical file is not part of database” When Restoring a Database in SQL Server

If you’re getting error 3234 that reads something like “Logical file ‘AdventureWorksLT_Data’ is not part of database ‘AdventureWorksLT2025’. Use RESTORE FILELISTONLY to list the logical file names.“, you’re referencing the wrong logical file names when restoring a database.

This issue can happen when you try to map the logical file names to a new location, but you get those logical file names wrong.

Fortunately there’s an easy fix. It involves looking up the actual logical file names, then modifying your RESTORE DATABASE statement accordingly.

Read more

What is a Snowflake Schema?

In relational databases, a snowflake schema is a variation of the star schema where dimension tables are normalized into multiple related tables. Instead of keeping all dimensional attributes in a single wide table, you break them down into a hierarchy of tables that branch out like (you guessed it) a snowflake.

It’s basically what happens when you apply database normalization principles to a star schema’s dimension tables while keeping the central fact table intact.

Read more

How to Install Oracle AI Database 26ai on a Mac (Using Docker)

Oracle Database 26ai has officially landed. As of January 27, 2026, Oracle finally flipped the switch on the General Availability (GA) for the Linux x86-64 version, bringing the “Enterprise Edition” to data centers everywhere. This marks a major turning point in Oracle’s recent rebranding saga, where the anticipated “23ai” was bumped up to 26ai to signal its role as the long-term support (LTS) foundation for the AI era.

Oracle Database has been a powerhouse in enterprise environments for decades, and the new “AI” branding reflects their recent addition of AI-powered features like vector search.

Read more

How to Exclude Specific Queries from Query Store in SQL Server

SQL Server’s Query Store captures all queries by default (when using QUERY_CAPTURE_MODE = ALL) or resource-intensive queries (when using AUTO). However, you may want to exclude certain queries from being tracked. These might include monitoring queries, maintenance scripts, or queries from specific applications that add noise to your performance data.

SQL Server doesn’t provide a built-in mechanism to exclude specific queries from Query Store by query text or pattern. But you can achieve similar results through several approaches.

Read more

Getting Started with the Netflix Sample Database in SQL

If you’re learning SQL or looking for a real-world dataset to sharpen your database skills, the Netflix sample database could be an option. This free, open-source database is based on publicly available information from Netflix’s Engagement Report and Global Top 10 weekly lists, making it both relevant and engaging for practice purposes.

Read more

What is Database as a Service (DBaaS)?

Database as a Service (DBaaS) is a cloud computing model where a provider hosts and manages your database for you. Instead of installing database software on your own servers, configuring it, and handling ongoing maintenance, you access a fully managed database over the internet. The provider takes care of all the technical heavy lifting while you focus on using the database for your applications.

Read more

Dynamic PIVOT in SQL Server for Unknown Column Values

Most pivot operations in SQL tend to use hardcoded column lists. This is where you explicitly specify every column name in the IN clause. That works great when you know exactly which values will appear in your data. But what happens when those values change? When new categories get added, when you’re working with user-generated data, or when you’re building a query that needs to work across different datasets?

That’s when you might want to consider dynamic PIVOT. Instead of hardcoding column names, you query the data to discover what columns you need, build the PIVOT query as a string, and execute it dynamically. It’s more complex than static PIVOT, but it’s pretty much essential when your column values aren’t predetermined.

Read more

Calculating Days Between a Fixed Date and Dynamic Dates with DATEDIFF()

Sometimes you need to measure how many days have passed between a specific reference point and a constantly moving target. SQL Server’s DATEDIFF() function handles this elegantly by letting you combine hardcoded dates with dynamic functions like GETDATE(). This can be useful for calculating things like age, days since an event, or time remaining until a deadline.

The main point here is that DATEDIFF() doesn’t care whether its date arguments are literals, functions, or even subqueries. It just needs two date values to compare. When you use GETDATE() or similar functions, you’re telling SQL Server to calculate the difference based on the current moment, which means the result changes every time you run the query.

Read more