SQL Projects for Data Analysts: Build a Job-Ready Portfolio

Finishing a SQL course and then wondering what to build next is the most common stall point for aspiring data analysts. You know SELECT, WHERE, GROUP BY, and maybe a few window functions. But when a hiring manager asks "walk me through an analysis you did," a certificate does not answer the question. A portfolio of business investigations does.
This page gives you ten SQL projects structured the way real analyst work actually happens: a business question, a dataset, a progressive set of queries that build from simple to complex, and a written insights memo that turns your result sets into something an interviewer can discuss with you. Each project tags the SQL techniques it certifies so you know exactly what skill each project proves when you walk into an interview.
SQL remains the most in-demand technical skill for data analyst roles. According to JetBrains' 2023 Developer Ecosystem Survey (conducted across 25,000+ developers globally), SQL is the third most-used programming language after JavaScript and Python. Burning Glass Technologies research (now part of Lightcast, analyzing millions of job postings) has consistently found SQL listed in approximately 57-65 percent of data analyst job descriptions in the US market more frequently than Python, R, or Tableau individually. Projects that demonstrate SQL depth are the single highest-leverage portfolio investment an aspiring analyst can make.
What Makes a SQL Project "Analyst-Grade"
Most SQL project lists give you a dataset and a set of exercises. That is practice, not a portfolio. An analyst-grade SQL project has three components that exercises lack:
1. A business scenario, not a query prompt. "Calculate total sales by region" is an exercise. "The regional sales director wants to know which product categories are underperforming in the Northeast and whether the trend is getting worse" is a business scenario. The second one requires you to decide what to calculate, not just how.
2. A progressive question ladder. Each project below has five questions that start simple (basic aggregations) and build to complex (multi-table joins with window functions and CTEs). This mirrors how a real analysis unfolds: you explore first, then investigate deeper based on what the data shows.
3. An insights memo. The deliverable is not your SQL file. It is a one-page summary of what you found the patterns, anomalies, and recommendations. This is the artifact that interviewers actually discuss. Your queries are the methodology; the memo is the output.
Each project below tags the SQL techniques it certifies. When an interviewer asks "can you work with window functions?" you point to the cohort retention project. When they ask "have you done multi-table analysis?" you point to the marketing campaign project. The technique tags are your evidence map.
Prerequisites: You should be comfortable with SELECT, WHERE, basic JOINs, and GROUP BY before starting these projects. If any of those feel shaky, Scaler's free SQL course covers the foundations with hands-on exercises before you move to project work.
Projects 1-3: Core Business Analysis
Project 1: E-Commerce Sales Performance Analysis
Business scenario: The head of e-commerce wants a quarterly performance review: which product categories are growing, which are declining, and where are the margin opportunities?
Dataset: Olist Brazilian E-Commerce Dataset on Kaggle contains approximately 100,000 orders across 8 interconnected tables covering orders, products, customers, sellers, payments, reviews, and geolocation from a Brazilian e-commerce platform (2016–2018).
Schema: orders, order_items, products, customers, sellers, payments, reviews, geolocation
Question ladder:
- What is total revenue by month and product category?
- Which product categories have declining revenue over the last 3 months?
- What is the month-over-month revenue growth rate by category?
- Which sellers have the highest fulfillment rate (delivered vs total orders)?
- Build a summary view combining category performance, delivery speed, and customer segment data.
Techniques certified: GROUP BY with HAVING, date functions, CASE statements, subqueries, multi-table JOINs, CTEs for growth calculations.
Memo prompt: Write a one-page summary for the head of e-commerce: top 3 growing categories, top 3 declining categories, and one recommendation for inventory reallocation.
Build an AI-First Career, Master the Complete Skillset
Choose from our industry-leading programs designed for career success
Modern Software and AI Engineering Program
Master full-stack development with AI integration
+1000 moreModern Data Science and ML with specialisation in AI
Advanced data science techniques with AI specialization
+1000 moreAdvanced AIML with Specialisation in Agentic AI
Deep dive into AIML with focus on Agentic systems
+1000 moreDevOps, Cloud & AI Platform Engineering
Build and manage AI-powered cloud infrastructure
+1000 moreAI Engineering Advanced Certification by IIT-Roorkee
Premier AI engineering certification from IIT-Roorkee
AI Forward Deployed Engineer Program
Full-stack engineering, production AI and client-facing consulting
+1000 moreProject 2: Marketing Campaign Performance Comparison
Business scenario: The marketing team ran three campaigns last quarter (email, social media, paid search) and wants to know which one drove the highest customer acquisition cost efficiency and repeat purchase rate.
Dataset: Marketing Campaign Dataset on Kaggle contains 2,240 customer records with response data across multiple campaign channels including email, social media, and direct mail.
Schema: customers, campaigns, responses, purchases, channels
Question ladder:
- What is the response rate by campaign channel?
- Which campaign generated the most total revenue and highest revenue per responding customer?
- What percentage of campaign responders made a second purchase within 30 days?
- Which customer demographics responded best to each channel?
- Build a campaign performance scorecard combining response rate, revenue, and retention metrics.
Techniques certified: Multi-table JOINs across 5 tables, aggregation with multiple GROUP BY columns, date-difference calculations, CASE for segment classification, window functions for ranking.
Memo prompt: Recommend which campaign to double budget on next quarter, with supporting evidence on acquisition cost and retention rate.
Project 3: Inventory Optimization Analysis
Business scenario: The warehouse manager needs to identify slow-moving products that are tying up capital, fast-movers that risk stockouts, and seasonal items that need timed restocking.
Dataset: Superstore Sales Dataset on Kaggle contains approximately 9,994 orders spanning 4 years of retail transaction data with product, category, and shipping details.
Schema: orders, products, returns, customers
Question ladder:
- What is total quantity sold by product in the last 90 days?
- Which products have zero sales in the last 60 days?
- What is the revenue contribution of the top 20% of products (Pareto analysis)?
- Which product subcategories show seasonal sales patterns?
- Build an inventory priority matrix: classify products as fast-movers, steady, slow, or dead stock.
Techniques certified: Date arithmetic, running totals with window functions, percentile calculations, CASE for classification, HAVING for filtering aggregated results.
Memo prompt: Identify the bottom 10 products by turnover rate and estimate the capital freed if they were discontinued.
Projects 4-6: Customer Analytics
Project 4: RFM Customer Segmentation
Business scenario: The CRM team wants to segment customers into actionable groups based on recency (how recently they purchased), frequency (how often they purchase), and monetary value (how much they spend) to design targeted retention campaigns.
Dataset: Online Retail Dataset on Kaggle contains approximately 541,909 transactions from a UK online retailer (December 2010 to December 2011) covering 4,372 unique customers across 37 countries.
Schema: transactions (invoice, customer, product, quantity, price, date, country)
Question ladder:
- Calculate recency (days since last purchase), frequency (total orders), and monetary value (total spend) per customer.
- Assign R, F, M scores (1–5) using NTILE or percentile buckets.
- Combine into RFM segments (Champions, At-Risk, Hibernating, etc.).
- What percentage of total revenue comes from each RFM segment?
- Which segments have the highest churn risk (R=1, F=1)?
Techniques certified: Window functions (LAG, NTILE, RANK), date-difference functions, CASE for segmentation logic, nested CTEs for multi-step calculations.
Memo prompt: Recommend a different retention strategy for each of the top 4 RFM segments, with the revenue at risk for each.
Project 5: Cohort Retention Analysis
Business scenario: The product team wants to understand whether newer customer cohorts retain better than older ones, and at which month post-acquisition the biggest drop-off occurs.
Dataset: Same Online Retail Dataset as Project 4.
Schema: transactions with customer ID and date
Question ladder:
- What is each customer's first purchase date (cohort assignment)?
- How many customers were acquired in each monthly cohort?
- What is the retention rate for each cohort at month 1, 3, 6, and 12?
- At which month post-acquisition does the steepest drop-off occur?
- Build a cohort retention heatmap table (cohort rows, months-post-acquisition columns).
Techniques certified: Window functions (FIRST_VALUE, LAG, ROW_NUMBER), self-joins, date truncation for cohort assignment, PIVOT-style aggregation, running calculations.
Memo prompt: Identify the month where retention drops most sharply and recommend a re-engagement campaign timed one month before that drop-off.
Project 6: Customer Churn Signal Detection
Business scenario: The customer success team wants to identify behavioral signals that precede churn — so they can intervene before high-value customers leave.
Dataset: Telco Customer Churn on Kaggle contains 7,043 customer records with service subscriptions, billing details, payment methods, and churn status from a telecommunications company.
Schema: customers, services, payments, churn_labels
Question ladder:
- What is the overall churn rate and churn rate by contract type?
- Which service combination has the highest churn rate?
- Do customers with multiple services churn less than single-service customers?
- What is the revenue at risk from customers in the top churn-risk segment?
- Build a churn-risk score combining tenure, contract type, payment method, and service count.
Techniques certified: Conditional aggregation (SUM with CASE), HAVING on aggregated results, multi-table JOINs, window functions for percentile ranking, nested CTEs for score construction.
Memo prompt: Identify the top 3 churn predictors and estimate the monthly revenue saved if the top 100 at-risk customers were retained.
How Scaler Transformed Careers in Different Fields
Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.
Projects 7-9: Domain Investigations
Project 7: Financial Transaction Anomaly Detection
Business scenario: The fraud team wants SQL-based rules to flag potentially fraudulent transactions unusually large amounts, rapid repeated transactions, and transactions at odd hours.
Dataset: Credit Card Fraud Detection on Kaggle contains 284,807 transactions made by European cardholders over 2 days in September 2013, of which 492 (0.172%) are fraudulent.
Schema: transactions (time, amount, class, V1–V28 anonymized features)
Question ladder:
- What percentage of transactions exceed 3 standard deviations from the mean amount?
- Which hours of the day have the highest transaction volume and average amount?
- Are there transactions that occur within 10 minutes of each other from the same card?
- What is the average transaction amount by hour of day?
- Build a composite anomaly score combining amount deviation, time-of-day, and frequency.
Techniques certified: Statistical functions (AVG, STDDEV), window functions (LAG for time-gap analysis, ROW_NUMBER for ranking), conditional aggregation, self-joins for consecutive-event detection.
Memo prompt: Recommend the top 3 SQL-based fraud rules for production deployment, with estimated false-positive rates.
Project 8: Healthcare Readmission Analysis
Business scenario: A hospital wants to identify which patient characteristics and visit patterns predict 30-day readmissions a key quality metric tied to reimbursement.
Dataset: Diabetes 130-US Hospitals Dataset on Kaggle contains 101,766 hospital admissions across 130 US hospitals (1999–2008) with diagnoses, medications, lab results, and readmission outcomes for diabetic patients.
Schema: admissions, patients, diagnoses, medications, lab_results
Question ladder:
- What is the overall 30-day readmission rate and readmission rate by primary diagnosis?
- Which age groups have the highest readmission rates?
- Does the number of medications at discharge correlate with readmission?
- What is the average length of stay for readmitted vs non-readmitted patients?
- Build a readmission-risk profile combining age, diagnosis, medication count, and prior admissions.
Techniques certified: Multi-table JOINs (5+ tables), date-difference calculations, conditional aggregation, window functions for prior-admission counting, CASE for risk scoring.
Memo prompt: Identify the patient profile with the highest readmission risk and recommend an intervention protocol for that segment.
Project 9: Food Delivery Operations Analysis
Business scenario: A food delivery platform wants to understand delivery time drivers, restaurant performance patterns, and customer satisfaction correlations.
Dataset: Food Delivery Dataset on Kaggle contains approximately 45,000 food delivery orders with timestamps, ratings, location data, and restaurant details.
Schema: orders, restaurants, delivery_agents, customers, ratings
Question ladder:
- What is the average delivery time by restaurant and time-of-day slot?
- Which restaurants have the highest order volume and customer rating?
- What is the relationship between order value and delivery time?
- What is the cancellation rate by restaurant and time slot?
- Build a restaurant performance score combining volume, speed, rating, and cancellation rate.
Techniques certified: Multi-table JOINs, aggregation across time dimensions, CASE for performance classification, window functions for ranking and percentile assignment, subqueries for composite scoring.
Memo prompt: Identify the bottom 5 restaurants by composite score and recommend specific operational improvements for each.
Turn Learning into Career Growth
Project 10: The Capstone Full Business Investigation
Business scenario: You are the newly hired data analyst at a mid-size retail company. The VP of Operations has given you access to the full transactional database and asked for a comprehensive quarterly business review covering sales trends, customer behavior, operational efficiency, and strategic recommendations.
Dataset: Brazilian E-Commerce Dataset (Olist) the most comprehensive dataset in this list, with 8 interconnected tables and approximately 99,000 orders.
Schema: All Olist tables: orders, order_items, products, customers, sellers, payments, reviews, geolocation
The capstone combines techniques from all previous projects:
Phase 1: Exploration
- Revenue trends, order volume patterns, category distribution
- Geographic distribution of customers and sellers
Phase 2: Customer Analysis
- RFM segmentation (from Project 4)
- Cohort retention (from Project 5)
- Customer lifetime value estimation
Phase 3: Operational Analysis
- Delivery performance by region and seller
- Payment method preferences and their relationship to order value
- Review score correlations with delivery time and product category
Phase 4: Strategic Synthesis
- Which product categories have both high growth and high customer satisfaction?
- Which regions have untapped potential (high demand signals, low seller coverage)?
- What is the relationship between seller performance and customer loyalty?
Techniques certified: Everything complex JOINs across 8 tables, window functions for trends and rankings, CTEs for multi-step analysis, CASE for classification, date arithmetic, statistical aggregations, subqueries.
Memo deliverable: A 2-page executive summary with:
- Three key findings supported by data
- Two strategic recommendations with projected impact
- One operational risk with mitigation suggestion
- Appendix with key query results
This capstone is your portfolio centerpiece. It demonstrates that you can take an open-ended business question, scope the analysis yourself, execute across multiple tables and technique areas, and deliver actionable recommendations. That is what an analyst does.
Publishing the Portfolio: GitHub and Memos
Your portfolio lives on GitHub. Here is how to structure it so that a hiring manager who clicks your resume link can evaluate you in under three minutes.
Repo structure per project:
README standards: Each README should answer four questions in the first paragraph: What is the business question? What dataset did you use? What was your approach? What did you find? If a hiring manager reads only your README, they should understand the project completely.
Query formatting: Write SQL for readers, not just execution. Use consistent indentation, uppercase keywords, meaningful aliases, and comments explaining the "why" behind complex logic. A hiring manager who opens your .sql file should be able to follow your reasoning without running the code.
The insights memo: This is the most important file in each project folder. It is a one-page markdown document that summarizes the analysis in business language no SQL, no technical jargon, just findings and recommendations. This is the artifact that gets discussed in interviews. When an interviewer asks "walk me through an analysis you did," you describe the memo.
For a broader view of how SQL projects fit into a complete data analyst portfolio (alongside Excel, BI tools, and Python), the 20 best data analyst projects guide maps the full portfolio composition that hiring managers look for.
Interview Translation and Next Steps
Here is how each project answers specific interview prompts:
| Interview Question | Your Project Answer |
|---|---|
| "Walk me through an analysis you did" | Capstone quarterly review (Project 10) |
| "How do you handle multi-table data?" | Marketing campaign analysis (Project 2) - 5-table JOINs |
| "Have you used window functions?" | Cohort retention (Project 5) - LAG, FIRST_VALUE, ROW_NUMBER |
| "How do you segment customers?" | RFM analysis (Project 4) - NTILE-based scoring |
| "Tell me about a time you found something unexpected" | Any project where the data contradicted assumptions |
| "How do you communicate findings?" | Your insights memos - show one during the interview |
The pattern in every answer: business context first, your approach second, findings third, impact fourth. The SQL is the methodology; the insight is the product.
What to learn next: These projects certify your SQL depth. The next layers for a data analyst career are BI tool proficiency (Tableau or Power BI for dashboarding the datasets you have already analyzed), Excel/Google Sheets for quick ad-hoc analysis, and basic Python or R for analyses that outgrow SQL. The data analyst roadmap maps the full skill stack in priority order. For the complete SQL learning path from basics through advanced techniques, the SQL roadmap guide covers what to learn and in what sequence.
SQL investigations are the analyst's craft. Go end to end from query to insight to business impact with Scaler's Data Science Program, which covers SQL, Python, statistics, and BI tools with mentor-led guidance and placement support.
FAQs
What SQL projects should a data analyst build for a portfolio?
Build business investigations, not query exercises. The most impactful projects are e-commerce sales analysis (demonstrates aggregations and trend analysis), RFM customer segmentation (demonstrates window functions and scoring logic), cohort retention analysis (demonstrates self-joins and date arithmetic), and at least one domain-specific investigation like fraud detection or healthcare readmissions (demonstrates that you can apply SQL to unfamiliar business contexts). Each project should end with a written insights memo this is the artifact that interviewers discuss.
Where can I find datasets for SQL projects?
Kaggle is the primary source for analyst-grade datasets. The datasets used in this article Olist e-commerce (99K orders), Online Retail (541K transactions), Telco Churn (7K customers), Credit Card Fraud (284K transactions), and Diabetes 130 (101K admissions) are all freely available and have enough complexity to support multi-table analysis. Load CSVs into a local MySQL or PostgreSQL instance to work with them using standard SQL. Public data portals like data.gov and city open-data portals are also good sources for domain-specific projects.
What SQL techniques should my projects demonstrate to employers?
The four technique areas that hiring managers probe are: multi-table JOINs across 3 or more tables (demonstrates data modeling understanding), aggregations with GROUP BY and HAVING (demonstrates summarization skills), window functions like LAG, LEAD, ROW_NUMBER, and NTILE (demonstrates analytical depth beyond basic SQL), and CTEs for readable multi-step logic (demonstrates code organization and communication). Projects 4, 5, and 10 in this article collectively certify all four areas.
How should I present SQL projects in my portfolio?
Host each project as a separate repository on GitHub with four files: a README explaining the business question and key findings, a formatted SQL file with commented queries, a one-page insights memo written in business language, and a schema file so the reviewer can set up the data locally. The README and memo are what get read; the SQL is what gets verified. Hiring managers typically spend under 3 minutes on a portfolio link, so the first paragraph of your README must convey the entire project.
How many SQL projects do I need to get a data analyst job?
Three to five projects completed to memo standard are more effective than ten shallow query dumps. Your portfolio should include at least one multi-table analysis project, one customer analytics project with window functions, and one capstone that demonstrates end-to-end investigation skills. Combined with basic proficiency in one BI tool (Tableau or Power BI) and Excel, this portfolio covers the technical evidence most entry-level analyst interviews require.
Are SQL projects alone enough to get hired as a data analyst?
SQL projects are the strongest single portfolio component for data analyst roles because SQL appears in approximately 57-65 percent of analyst job descriptions according to Lightcast/Burning Glass research. However, most hiring managers also expect basic proficiency in a visualization tool and spreadsheet analysis. The complete entry-level analyst portfolio is: 3-5 SQL investigation projects, one dashboard built from one of those SQL datasets, and the ability to discuss your findings clearly in an interview setting.