SQL is non-negotiable for data analysts. You'll use it in literally every job. So your portfolio better prove you know it.
Here are 3 SQL project types that consistently impress recruitersβplus datasets and starter queries to help you build them.
Project 1: Customer Segmentation Analysis
Why this project works: Every business cares about customers. Showing you can segment them by behavior proves you understand business value, not just technical skills.
What you'll demonstrate:
- JOINs across multiple tables
- Aggregate functions (SUM, COUNT, AVG)
- GROUP BY and HAVING clauses
- Subqueries or CTEs (Common Table Expressions)
The goal: Group customers into segments based on purchase frequency, total spend, and recency.
Dataset to use:
Kaggle's "Online Retail" dataset (free, clean enough for beginners)
Starter query example:
SELECT
customer_id,
COUNT(DISTINCT invoice_no) AS total_orders,
SUM(quantity * price) AS total_spend,
MAX(invoice_date) AS last_purchase_date,
CASE
WHEN COUNT(DISTINCT invoice_no) >= 10 THEN 'High Frequency'
WHEN COUNT(DISTINCT invoice_no) >= 5 THEN 'Medium Frequency'
ELSE 'Low Frequency'
END AS customer_segment
FROM sales
GROUP BY customer_id
ORDER BY total_spend DESC;
Next steps:
- Calculate RFM scores (Recency, Frequency, Monetary value)
- Identify your top 20% customers by revenue
- Find customers who haven't purchased in 6+ months
Presentation tip: Create a summary table showing how many customers fall into each segment and what percentage of revenue they generate.
Project 2: Sales Trend Analysis
Why this project works: Time-series analysis is everywhere in business. Showing you can identify trends and seasonality makes you immediately valuable.
What you'll demonstrate:
- Date functions (YEAR, MONTH, QUARTER)
- Window functions (ROW_NUMBER, LAG, LEAD)
- Calculating growth rates and moving averages
- Handling time-based data
The goal: Analyze sales performance over time, identify peak seasons, and calculate month-over-month growth.
Dataset to use:
Kaggle's "Superstore Sales" dataset or any retail sales data
Starter query example:
SELECT
DATE_TRUNC('month', order_date) AS month,
SUM(sales) AS total_sales,
COUNT(DISTINCT order_id) AS total_orders,
SUM(sales) - LAG(SUM(sales)) OVER (ORDER BY DATE_TRUNC('month', order_date)) AS sales_change,
ROUND(((SUM(sales) - LAG(SUM(sales)) OVER (ORDER BY DATE_TRUNC('month', order_date)))
/ LAG(SUM(sales)) OVER (ORDER BY DATE_TRUNC('month', order_date))) * 100, 2) AS growth_percentage
FROM orders
GROUP BY DATE_TRUNC('month', order_date)
ORDER BY month;
Next steps:
- Compare year-over-year performance
- Identify your best and worst performing months
- Find products with seasonal demand
- Calculate 3-month moving averages
Presentation tip: Pair your SQL results with a line chart showing sales trends over time. Annotate any major spikes or drops with explanations.
Project 3: Product Performance & Inventory Analysis
Why this project works: Shows you understand operational analyticsβhow data drives real business decisions like what to stock and what to discount.
What you'll demonstrate:
- Multiple JOINs (products, categories, sales)
- Ranking (RANK, DENSE_RANK)
- Conditional logic (CASE statements)
- Performance optimization thinking
The goal: Identify top-performing products, slow-moving inventory, and opportunities for promotions.
Dataset to use:
Any e-commerce or retail dataset with product and sales tables
Starter query example:
SELECT
p.product_name,
p.category,
COUNT(DISTINCT s.order_id) AS times_sold,
SUM(s.quantity) AS total_units_sold,
SUM(s.revenue) AS total_revenue,
RANK() OVER (PARTITION BY p.category ORDER BY SUM(s.revenue) DESC) AS revenue_rank_in_category
FROM products p
LEFT JOIN sales s ON p.product_id = s.product_id
GROUP BY p.product_id, p.product_name, p.category
ORDER BY total_revenue DESC;
Next steps:
- Find products that haven't sold in 3+ months (potential clearance items)
- Calculate profit margins if cost data is available
- Identify products frequently bought together (market basket analysis)
- Compare performance across regions or stores
Presentation tip: Create a "Product Health Dashboard" showing top performers, underperformers, and recommendations for inventory management.
Bonus Tips for All 3 Projects
1. Document your queries
Add comments explaining what each section does. Future employers (and future you) will appreciate it.
2. Show multiple approaches
If you can solve the same problem with a subquery or a CTE, show both and explain when you'd use each.
3. Include data quality checks
Show queries that check for nulls, duplicates, or outliers. Real-world data is messy. Prove you can handle it.
4. Connect to business impact
Don't just say "I ranked products by sales." Say "I identified the top 10% of products generating 60% of revenue, which could inform inventory decisions."
Where to Host Your SQL Projects
- GitHub: Upload your .sql files with a detailed README
- Medium/Dev.to: Write a blog post walking through your analysis
- Your portfolio site: Embed code snippets and results
Final thought: SQL projects prove you can work with data where it lives (in databases). These three project types cover the core skills employers actually need: customer analysis, trend identification, and product performance.
Pick one. Start today. You'll have a portfolio-ready project by next week.
Need help getting started? Our portfolio template includes sections specifically designed to showcase SQL projects effectively.