Problem You want to remove duplicates in SQL. You know it is easy to find duplicates using GROUP BY, but how do

Read More
Find and Remove Duplicates in SQL

Problem You need to find duplicates and then identify the records by their primary keys. Background Here’s an example of how to

Read More
How to Find Duplicates using a Windows Function?

Problem How do you create a moving average using windows functions in SQL? Background There is no built-in function to create a

Read More
Calculate a Moving Average in SQL using A Windows Function

Problem How do you create a running total on a column using SQL? Background There is no built-in function to create a

Read More
Calculate a Running Total in SQL using a Windows Function

Introduction Window functions are an essential tool for data analysis, particularly in the SQL language. They allow you to perform complex calculations,

Read More
Working with ROW_NUMBER, RANK, and DENSE_RANK

In this puzzle, we’re going to learn how to calculate moving averages by working through a hypothetical stock market example. Solving puzzles

Read More
SQL Puzzle:  How to Calculate Moving Averages

If you want to find duplicate rows in SQL, you can go two routes. The first is to use the GROUP BY

Read More
How To Find Duplicates in SQL using Window Functions

The purpose of this article is to introduce you to SQL window functions and some of the high-level concepts.  In SQL, a

Read More
Window Functions in SQL – What are they?

In this puzzle, we’re going to learn how to find a gap in a sequence using SQL Server.  I was recently reviewing

Read More
How to Find a Gap in a Sequence using SQL SERVER

In this puzzle, we’re going with with SQL Percentile Rank to work through a problem to identify the top and bottom student

Read More
SQL Percentile Rank Puzzle