注册数的累计总计
您给 Bob 的路演材料提了个建议:折线图不必按月展示当月注册数,可以改为按月展示注册数的累计总计。这样数字更大,投资人通常更看重"大数字"。他同意了,您开始编写查询,返回一张按月给出注册数累计总计的表。
本练习是课程的一部分
使用 SQL 分析业务数据
交互式实操练习
通过完成这段示例代码来试试这个练习。
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 ___;