At the end of this course, you will be able to write complex window functions with ease. Just take a look at the following query, which allows us to see the sum of all payments made by one customer and, in a separate column, the lowest total payment made by any customer:
SUM(SingleRental.PaymentAmount) AS Total Payments,
ROWS BETWEEN UNBOUNDED PRECEDING
AND UNBOUNDED FOLLOWING
) AS MinTotalPayment
INNER JOIN Customer
ON Customer.Id = SingleRental.CustomerId
GROUP BY Customer.FirstName,
Such queries won't be a problem for you at all! But as we mentioned previously, there are some prerequisites. Let's start with a short quiz that will test your current T-SQL skills. If you know the answers to all the questions, this course is right for you! Don't worry, you won't have to write much: the quiz is going to be short and painless.
First, let's take a look at the tables we'll use for the quiz. We're going to work with information about dogs and their owners.