Skip to content
Aabha AI Academy
Skip to reading

SQL

05B

Compare these references after your own attempt. You can read them at any time; they do not record a live model or vendor run.

-- 05b: Find repeat completed buyers
SELECT customer_id,COUNT(*) AS completed_orders FROM aabha_sql.orders
WHERE status='completed' GROUP BY customer_id HAVING COUNT(*)>=2 ORDER BY customer_id;

Download this source file