+91 99301 12627
Python & SQL

10 SQL Projects for Beginners to Build Your Data Portfolio

By Mehul Prajapati

Inside of a hard drive representing databases for SQL projects
On this page

Short answer: Good SQL projects for beginners answer real business questions on a realistic database: for example, “Which products drive revenue growth?”, “Which customers are at risk?” or “Where do users drop off?”. Each project should show joins, GROUP BY aggregations, CTEs and window functions, and end with clear insights. Build 3–4 projects, publish the queries and a short write-up on GitHub, and you’ll have strong proof of SQL skills for data analyst and data scientist roles.

Key takeaways

  • Start every project with business questions, not queries.
  • Show a range of skills: joins, aggregations, CTEs, window functions.
  • Present insights and recommendations, not just SQL.
  • One database design project shows you understand schemas.

The 10 projects

# Project Example questions Skills
1 Retail sales analysis Top products, monthly growth, best regions GROUP BY, date functions
2 Customer segmentation (RFM) Who are loyal, at-risk and new customers? CTEs, NTILE
3 HR attrition analytics Attrition by department, tenure and salary band CASE, aggregations
4 E-commerce funnel View → cart → purchase conversion Conditional counts
5 Library management database Design tables, overdue books, popular titles Schema design, keys, joins
6 Cohort retention Do customers return months after first purchase? Window functions, date maths
7 Inventory and supplier analysis Low stock, slow movers, supplier delays Joins, HAVING
8 Movie or music database insights Top genres, ratings trends Joins across many tables
9 Hospital appointments No-show rate, busiest days, doctor load Date grouping, rates
10 Website/app event analysis Daily active users, session counts, feature usage COUNT DISTINCT, window functions

Example queries

Monthly revenue and growth

WITH monthly AS (
  SELECT DATE_FORMAT(order_date, '%Y-%m') AS month, SUM(amount) AS revenue
  FROM orders
  GROUP BY month
)
SELECT month, revenue,
       ROUND(100 * (revenue - LAG(revenue) OVER (ORDER BY month))
             / LAG(revenue) OVER (ORDER BY month), 1) AS growth_pct
FROM monthly;

Top 3 products per category

WITH ranked AS (
  SELECT p.category, p.product_name, SUM(o.amount) AS revenue,
         DENSE_RANK() OVER (PARTITION BY p.category ORDER BY SUM(o.amount) DESC) AS rnk
  FROM orders o JOIN products p ON o.product_id = p.product_id
  GROUP BY p.category, p.product_name
)
SELECT * FROM ranked WHERE rnk <= 3;

Customers who haven’t ordered in 90 days

SELECT c.customer_id, c.name, MAX(o.order_date) AS last_order
FROM customers c
LEFT JOIN orders o ON c.customer_id = o.customer_id
GROUP BY c.customer_id, c.name
HAVING last_order IS NULL OR last_order < CURDATE() - INTERVAL 90 DAY;

The examples use MySQL syntax (window functions need MySQL 8+). Refresh concepts with SQL joins and window functions.

Where to get data

  • Sample databases that ship with or are published for MySQL and PostgreSQL
  • Public dataset repositories (import CSVs into tables)
  • Generate realistic fake data with Python (mention this in your write-up)

How to present SQL projects

  • README: business problem, schema diagram, list of questions
  • One .sql file per question with comments
  • Results tables or charts, plus 3–5 insights
  • Optional: connect the database to Power BI for a dashboard; see Power BI projects

Frequently asked questions

Which database should I use?

MySQL or PostgreSQL are both free and widely used; the core SQL skills transfer between them.

How many SQL projects do I need?

Three or four varied projects are enough to demonstrate solid skills.

Are SQL projects enough for a data analyst job?

Combine them with Excel and Power BI, and you have the core analyst toolkit. See the data analyst roadmap.

How do I prepare for SQL interviews?

Practise with SQL interview questions and explain your projects’ queries out loud.

Conclusion

Pick a few of these SQL projects for beginners, start from real business questions, use joins, CTEs and window functions, and publish clear insights. It’s one of the fastest ways to prove you’re ready for analyst work.

Build SQL projects with expert guidance in our MySQL course.

Learn with Mehul Prajapati in Borivali West

At Mehul Prajapati’s institute, you get 100% practical, hands-on training by industry experts with a minimum of 5+ years of experience, plus job-oriented programmes with placement support. Weekday and weekend batches are available, with multiple 2-hour slots between 8 am and 6 pm.

Address: 12th Floor, 1214, Gold Crest Business Centre, LT Rd, Above Westside Showroom, Borivali West, Mumbai, Maharashtra 400092
Call: +91 99301 12627 / +91 96645 45072

Visit the centre or call us to choose the right course and batch and to know the current fee structure.