At the end of this course, you will be able to write complex window function examples with ease. Just take a look at this query, which allows us to see the sum of payments a given person made, and the fourth largest value of the sum of payments as a separate column:
NTH_VALUE(SUM(payment_amount),4) OVER(ORDER BY
ROWS BETWEEN UNBOUNDED PRECEDING
AND UNBOUNDED FOLLOWING)
GROUP BY first_name, last_name;
Such queries won't be a problem for you at all! But, as we mentioned previously, there are some prerequisites. Precisely speaking, you need to know how to retrieve data from a single table, from multiple tables (with
JOINs), how to use
GROUP BY and
We've decided to prepare a short quiz for you that will test your skills. The rule is simple: if you know the right 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 dogs and their owners.