Last week I wrote about some of the newer innovations in the SQL space. This got me thinking. What other language features would be useful in a SQL environment? This post explores some ideas I’ve had around this. It’s purely speculative, but perhaps it will spark some ideas for you. 1. Optional GROUP BY clause […]
On 30 April 2025, DataBricks announced their SQL pipe operator. Without giving you a full rundown of what it is and what it does, here’s a quick example which should give you a good idea. This query: Is now equivalent to this: There’s more to it of course, but that’s the gist of it. It […]
When working with databases, it’s crucial to know the best methods to query data effectively. In SQL, two powerful operations that allow you to compare sets of data are the INTERSECT operator and the INNER JOIN clause. Both commands serve the purpose of identifying commonalities between datasets, but they do so in subtly different ways […]
The full script for this post can be found here. This post uses the AdventureWorksDW database in SQL Server 2019 Express. Depending on your preference, you can either watch this video or read below. The goal Suppose we have a request to produce a report: Create a report showing internet sales amount with these columns: […]
The full script for this post can be downloaded here. The following post was written primarily in Postgres 14 and tested in both Postgres and MySQL. While the data generation and use of EXCEPT are not supported natively in MySQL, the principles of row comparisons are equivalent. Setup To demonstrate how a row constructor comparison […]
What is Advanced SQL, anyway? I think about this sometimes. Is it window functions? CTEs? I don’t know. Some of it is trickier than others. I think it’s relative to how much practice you’ve had and depends a great deal on the data in front of you. Anyway, I saw this post on LinkedIn by […]