Order Cadence Explorer

Order Cadence Explorer :Rank Customers by Order Frequency and Analyze Average Time Gaps Between Purchases Advanced

Rank customers by total orders and calculate their average time between orders.

Xorthax wants to analyze customers' order patterns. Write a query to calculate the rank of each customer's total number of orders and the average time between consecutive orders. Order the results by the rank then average time between orders; both ascending.
Write Your Query
Next Problem →

This represents examining customer purchasing frequency to understand engagement levels and time gaps between repeat orders.

You'll practice ranking aggregated results and calculating average intervals between sequential time-based records.

This problem is labeled as Advanced. It’s intended for learners who are already comfortable with common window functions and want to push into more complex analytical patterns. Don’t rush — work through the hints one at a time and study the final query structure carefully.

Yes. Every problem comes with optional hints you can reveal one at a time, plus a fully worked step-by-step solution. You decide how much help you want while practicing.

All problems on PracticeWindowFunctions.com are completely free and can be solved without creating an account. Right now there are over 80 practice problems, with new ones added regularly.
Ace the Data Science Interview
Ace the Data Science Interview

Comprehensive prep for data interviews: SQL, stats, product sense, and case studies.

(Affiliate link – as an Amazon Associate I earn from qualifying purchases.)