Get startedGet started for free

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.

This exercise is part of the course

Analyzing Business Data in SQL

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

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 ___; 
Edit and Run Code