Skip to content
KALANBLON
Show contents

Chapter 3 of 7 · 10 min

Quiz: analytical queries

Window functions and recursive CTEs: let's check that you can analyse data without losing the detail. You need 70% correct answers.

Quiz

6 questions · pass mark: 70%

  1. 1.What's the difference between SUM(amount) with GROUP BY month and SUM(amount) OVER (PARTITION BY month)?

    One answer

  2. 2.The amounts 1600, 1250, 1250, 800 are ranked in decreasing order. What does DENSE_RANK() give?

    One answer

  3. 3.Complete to read the previous month's amount.

    Complete the code

    SELECT month, amount,
           ____(amount) OVER (ORDER BY month) AS previous
    FROM sales;
  4. 4.Why does WHERE RANK() OVER (…) = 1 cause an error?

    One answer

  5. 5.Which statements about recursive CTEs are true? (several answers)

    Several answers possible

  6. 6.To go up from Sami to the director, which join condition does the recursive part use?

    One answer

Your progress is saved on this device. Create a free account to keep your progress on all your devices.