Skip to main content
SQL โ€ข LESSON 186

Repeat Customers

How can we find customers who placed multiple orders?

Advancedโฑ 3 Minutesโญ 1990 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