This repository highlights practical SQL projects I have worked on, with a focus on business analytics and reporting.
It contains queries that demonstrate how SQL can be used to answer real business questions, build KPIs, and support decision-making.
The repository includes a small commerce-style dataset stored in the data
folder:
- Customers
- Orders
- Order Items
- Products
These tables represent a simplified transactional environment, which allows me to demonstrate SQL solutions that are directly relevant to business problems.
The main queries are available in the sql
folder:
- Monthly Revenue KPIs: calculates GMV, orders, active customers, and AOV per month.
- Cohort Retention: measures how customers from different signup months remain active over time.
- RFM Segmentation: builds a recency, frequency, and monetary table for customer analysis.
- Churn Candidates: identifies customers who have not purchased in the last 60 days.
- Pareto 80/20 Products: uses window functions to show which products contribute the most to total revenue.
- Load the CSV files into your database of choice (PostgreSQL, MySQL, or BigQuery).
- Run the SQL scripts in your SQL client or terminal.
- Adjust date functions slightly if you are working in BigQuery or MySQL, as syntax may differ.
- Ability to translate business questions into SQL solutions.
- Experience with KPIs such as revenue, retention, churn, and product performance.
- Competence with advanced SQL techniques including joins, CTEs, and window functions.
This portfolio demonstrates the type of SQL work I deliver in real analytics and BI roles.