5 SQL Projects to Build After You Learn the Basics
SQL projects for your portfolio separate you from every other candidate who just finished a course. Here are five that cover the concepts employers actually care about.
Finishing your first SQL course feels like an accomplishment — and it is. But the moment you start job hunting, you’ll notice something: everyone else finished the same SQL course. The certificate doesn’t differentiate you. SQL projects do.
A portfolio project proves something a course never can — that you can take an open-ended problem, figure out which questions to ask, write the queries to answer them, and communicate what you found. That’s the actual job. No tutorial walks you through it.
Here are five SQL projects worth building, in roughly the order you should tackle them — from straightforward to genuinely impressive.
E-commerce datasets are ideal for first SQL projects — the business logic is intuitive, the data structure is clean, and there are endless questions to answer. Traffic sources, conversion rates, session-to-order rates, revenue per visitor — all of these can be answered with intermediate SQL.
Good questions to answer in this project:
- Which traffic sources drive the most revenue?
- What is the conversion rate by channel?
- Which landing pages perform best for paid traffic?
- Did a specific A/B test lift conversion rates?
- What is the monthly revenue trend?
This is exactly what my first SQL project covers — 8 business questions answered on a real Maven Analytics e-commerce dataset. Read the full analysis →
RFM analysis — segmenting customers by Recency, Frequency, and Monetary value — is one of the most widely used techniques in marketing analytics and CRM. It’s also one of the best SQL projects you can build because it requires window functions, multiple CTEs, and business interpretation of results.
The project involves:
- Calculating days since last purchase (recency)
- Counting total orders per customer (frequency)
- Summing total spend per customer (monetary)
- Using NTILE() to score each dimension 1–5
- Combining scores to create segments: Champions, Loyal, At Risk, Lost
RFM is a real business technique used by actual marketing teams. When you include it in a portfolio, you’re not just showing SQL skills — you’re showing business understanding. That’s the combination that gets callbacks.
Cohort analysis tracks how groups of customers acquired in the same period behave over time. It’s the standard way to measure retention — one of the most important metrics in any subscription or repeat-purchase business. Building this project teaches you date manipulation, self joins, and multi-step CTE logic.
The core question: of all customers who made their first purchase in Month 1, what percentage came back in Month 2, Month 3, Month 6, Month 12?
- Assign each customer to an acquisition cohort (first purchase month)
- Track subsequent purchases across months
- Calculate month-over-month retention rates
- Identify at which month retention drops most sharply
The tricky piece is computing “months since first purchase” for each transaction. Use DATEDIFF and PERIOD_DIFF functions, or calculate it as the difference between the transaction month and the cohort month. Once that column exists, the rest is aggregation.
A retail analysis project covering sales trends, product profitability, customer demographics, and regional performance gives you the breadth to show multiple skills in one portfolio piece. This type of project mirrors what analysts actually do at retail companies — and it’s directly relevant to a wide range of job descriptions.
Questions worth covering:
- Which product categories drive the most revenue and margin?
- How do sales trends differ by region and channel?
- Which 20% of products generate 80% of revenue? (ABC analysis)
- What does the customer demographic breakdown look like?
- How does online compare to in-store performance?
My Contoso Retail project covers all of this — 10 business questions across sales, customer segmentation, RFM, CLV, cohort retention, and ABC analysis on a real Microsoft retail dataset. Read the full analysis →
CLV — Customer Lifetime Value — is one of the most important metrics in any customer-facing business. It answers the question: how much revenue does a typical customer generate over their entire relationship with the company? Building a CLV model in SQL requires multi-step CTE logic, date arithmetic, and careful business reasoning.
A complete CLV project includes:
- Calculating average order value per customer
- Calculating purchase frequency (orders per year)
- Estimating customer lifespan (first to last purchase)
- Combining these into a CLV estimate per customer
- Ranking customers by CLV and identifying the top tier
CLV modeling shows financial business acumen alongside technical SQL skill. Any company that cares about customer retention — which is most of them — will recognise this immediately. It’s the project that gets you into senior analyst conversations.
How to Make These Projects Portfolio-Ready
Building the queries is only half the work. To make these SQL projects actually useful in a job search, document them properly:
- Write a README — explain the dataset, the business context, and the questions you answered
- Comment your SQL — explain what each query does and why, not just what it outputs
- Include your findings — what did the data actually show? What would you recommend?
- Put it on GitHub — with a clean folder structure and a link you can share in applications
- Write it up as a blog post — this is the highest-leverage move for visibility and SEO
A well-documented SQL project tells a story — here’s the problem, here’s how I approached it, here’s what I found, here’s what it means. That narrative is what sticks in an interviewer’s memory long after they’ve reviewed fifty CVs.
