• 5 ideas for new SQL features!

    ,

    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 […]

    5 ideas for new SQL features!
  • SQL is changing into something new – are you ready?

    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 […]

    SQL is changing into something new – are you ready?
  • Professional SQL That Will Make Your Queries Shine: INTERSECT vs. INNER JOIN

    ,

    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 […]

    Professional SQL That Will Make Your Queries Shine: INTERSECT vs. INNER JOIN
  • What’s the difference between ROLLUP and GROUPING SETS in SQL?

    ,

    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: […]

  • SQL: Numerical row constructor comparisons in PostgreSQL and MySQL

    ,

    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 […]

  • SQL: Use LAG and SUM window functions to group rows

    ,

    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 […]