Registrations running total
You have a suggestion for Bob's pitch deck: Instead of showing registrations by month in the line chart, he can show the registrations running total by month. The numbers are bigger that way, and investors always love bigger numbers! He agrees, and you begin to work on a query that returns a table of the registrations running total by month.
Deze oefening maakt deel uit van de cursus
Analyzing Business Data in SQL
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
WITH reg_dates AS (
SELECT
user_id,
MIN(order_date) AS reg_date
FROM orders
GROUP BY user_id)
SELECT
-- Select the month and the registrations
___ :: DATE AS delivr_month,
___ AS regs
FROM reg_dates
GROUP BY delivr_month
-- Order by month in ascending order
ORDER BY ___;