Skip to main content
SQL • LESSON 186

Repeat Customers

How can we find customers who placed multiple orders?

Advanced3 Minutes1990 XP
🤔 THE QUESTION

How can we find customers who placed multiple orders?

💡 WHAT IS IT?

Grouping orders by customer and applying HAVING COUNT(*) > 1 filters for repeat purchasing customers.

🎯 WHAT IS IT USED FOR?

Retention analytics, loyalty program enrollment, repurchase rate calculation.

💻 EXAMPLE
SELECT
customer_id,
COUNT(*) AS order_count
FROM orders
GROUP BY customer_id
HAVING COUNT(*) > 1;

🎯 Mission Objectives

Practice typing production-grade SQL code for Repeat Customers.

  • Repeat customer detection
  • HAVING COUNT > 1
  • Retention metrics
  • Repurchase behavior