开始使用免费开始使用

每日交易量

现在请您对 BikeShare 数据集做一次时间序列 EDA。编写查询,统计每天有多少笔交易。

有时数据集来自多个来源,此查询可帮助您判断是否存在缺失数据。

本练习是课程的一部分

SQL Server 中的函数与存储过程编写

查看课程

练习说明

  • 使用 CONVERT()SELECTGROUP BY 中选取 StartDate 的日期部分。
  • 使用 COUNT() 统计每个 StartDate 的记录数量。
  • StartDate 的日期部分对结果排序。

交互式实操练习

通过完成这段示例代码来试试这个练习。

SELECT
  -- Select the date portion of StartDate
  ___(___, StartDate) as StartDate,
  -- Measure how many records exist for each StartDate
  ___(___) as CountOfRows 
FROM CapitalBikeShare 
-- Group by the date portion of StartDate
___ BY ___(___, StartDate)
-- Sort the results by the date portion of StartDate
___ BY ___(___, StartDate);
编辑并运行代码