Group customers into cohorts based on the month of their first order. For each cohort, show the number of customers, total revenue from the cohort, and average revenue per customer. Use a CTE to find each customer's first order month.
Schema
🔑idINT
first_nameTEXT
last_nameTEXT
emailTEXT
phoneTEXTNULL
cityTEXT
stateTEXT
countryTEXT
created_atTIMESTAMP
postgresql
Run your query to see results
Press Ctrl + Enter to execute