The Analyst / SQLAll lessons ↗
Day 23 · SQL mastery path

Finding duplicates

GROUP BY and HAVING COUNT(*) > 1 identifies repeated values.

01 · Learn

Study the pattern

GROUP BY and HAVING COUNT(*) > 1 identifies repeated values. Predict the output before running the example.

SELECT customer_id,COUNT(*) AS order_count FROM orders GROUP BY customer_id HAVING COUNT(*)>1 ORDER BY customer_id;
02 · Recall

Explain it from memory

What does today's SQL feature do, and when would you use it?

03 · Practice

Run SQL in your browser

Run the example, then modify one clause and predict how the result changes.

Loading SQL engine…
04 · Repeat

Consolidate the skill