Exercise

Inline TVF

Create an inline table value function that returns the number of rides and total ride duration for each StartStation where the StartDate of the ride is equal to the input parameter.

Instructions

100 XP
  • Create a function named SumStationStats that has one input parameter of type datetime - @StartDate - and returns a TABLE data type.
  • Calculate the total RideCount using COUNT() and ID.
  • Calculate the TotalDuration using SUM() and DURATION.
  • Group by StartStation.