r/learnSQL • u/unaplogetic_sam • Nov 25 '25
Best small projects to learn GROUP BY, HAVING, and window functions.
I’m new to SQL and I want project ideas that force me to use GROUP BY, HAVING, and window functions (ROW_NUMBER, SUM() OVER). Prefer short, industry-relevant datasets (ecom / SaaS).
What 3 mini-projects would you recommend that show measurable business value? Please include expected deliverables (queries, chart, one insight).
18
Upvotes
4
u/PythonEntusiast Nov 25 '25
LeetCode. Or Udemy courses.
1
u/Big_Fudge_4370 Dec 12 '25
A good way to get comfortable with GROUP BY, HAVING, and window functions is to pick projects that look like real work an analyst would actually do. Here are three short ones that hit all the skills you mentioned and also produce business-relevant insights.
1. E-commerce: “Top Products + Revenue Concentration”
Dataset: orders, order_items, products
What to do:
SUM(revenue) OVER (ORDER BY revenue DESC)to build a running contribution curve Deliverables:2. SaaS: “Customer Lifecycle + Cohort Retention”
Dataset: customers, subscriptions, usage
What to do:
DATE_TRUNC()ROW_NUMBER()to identify each customer’s first month3. Marketing analytics: “Campaign Lift + ‘Power User’ Segments”
Dataset: sessions, campaigns, conversions
What to do:
ROW_NUMBER() OVER (ORDER BY conv_rate DESC)) Deliverables:All three are small enough to complete in an evening but close enough to real analyst tasks that you’ll actually use these patterns later.