SQL Practice Logo

SQLPractice Online

Scenario SQL Question

Time to First Repeat Purchase

Build mastery in Date Operations with this scenario-based SQL challenge and live execution support.

Problem Statement

For each customer, compute the number of days between their first and second order. Return customer_id, first_order, second_order, days_to_repeat — ordered by days_to_repeat, customer_id.

Relevant Tables

orders

SQL Concepts Used in This Scenario

Strengthen your understanding with these targeted learning topics: