How long until items come back?

MediumAmazondate mathjoinsaggregation· 20 XP

Amazon's returns team wants to know how quickly items come back for each return reason, to plan warehouse staffing.

For each return reason, show the number of returns and the average number of days between the order date and the return_date.

Expected output

  • avg_days rounded to 1 decimal; any row order

Example of the shape (made-up values):

reason returns avg_days
damaged 22 13.6

Hints, the later steps and the answer come with Pro.

Write your query here. Ctrl + Enter submits.