ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Analyzing Business Data in SQL

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

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 ___; 
Editar y ejecutar código