SQL Practice Logo

SQLPractice Online

Company SQL Question

Customer Order Frequency Analysis

Practice this Amazon style SQL interview question with live execution and instant feedback.

Problem Statement

Calculate the longest gap (in days) between consecutive orders for each customer who has placed at least 3 orders. Show customer name, email, total orders, average gap in days, and maximum gap in days.

Relevant Tables

orderscustomers

SQL Concepts Used in This Question

Strengthen your understanding with these targeted learning topics: