Well done! So far, we've only compared the number of customers who've made or didn't make a purchase. Now, we'd like to go deeper and analyze how much time customers take between registration and their first purchase. Check out the following query:
DATEDIFF(Day, RegistrationDate, FirstOrderDate) AS DaysToFirstOrder
In the second column, we used the
DATEDIFF(Period, StartDate, EndDate) function to calculate the number of days between the user's registration and their first order. Instead of days, we can also use other time units (hours, minutes, weeks, etc.).