https://github.com/bakulwani/data-mart-weekly-sales
Cleaned and analyzed weekly sales data using SQL to build a business-focused data mart with KPIs, customer segmentation, and platform insights.
https://github.com/bakulwani/data-mart-weekly-sales
customer-segmentation data-analysis data-cleaning etl kpi-analysis mysql sales-analysis sql
Last synced: 4 months ago
JSON representation
Cleaned and analyzed weekly sales data using SQL to build a business-focused data mart with KPIs, customer segmentation, and platform insights.
- Host: GitHub
- URL: https://github.com/bakulwani/data-mart-weekly-sales
- Owner: bakulwani
- Created: 2025-06-29T06:56:49.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-29T07:17:50.000Z (12 months ago)
- Last Synced: 2025-10-28T19:46:45.129Z (8 months ago)
- Topics: customer-segmentation, data-analysis, data-cleaning, etl, kpi-analysis, mysql, sales-analysis, sql
- Homepage:
- Size: 249 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π Data Mart Project β Weekly Sales Analysis
This project builds a focused **sales data mart** using SQL. It demonstrates my ability to clean, transform, and analyze real-world transactional data to extract business insights. All logic is implemented using pure SQL, with no external tools or programming.
---
## π§ What This Project Demonstrates
- β
End-to-end SQL-based data transformation and analysis
- β
Data cleaning and enrichment using string and date functions
- β
Customer segmentation by age and demographic
- β
Business metric analysis (sales, transactions, platform performance)
- β
Use of **CTEs**, **window functions**, **aggregations**, and **subqueries**
---
## π Project Structure
|File Name | Description |
|---------------------------------------|-----------------------------------------------------------------------------|
| `01_create_and_load_weekly_sales.sql` | Creates the `weekly_sales` table and inserts 1000+ rows of data |
| `02_weekly_sales_analysis.sql` | Cleans the raw data and performs 7 key business analyses |
| `README.md` | Project documentation (youβre reading it) |
---
## π Key Business Insights Analyzed
This project answers real-world business questions such as:
1. **Which week numbers are missing from the sales records?**
2. **How do transactions vary by year?**
3. **What are the total sales by region and month?**
4. **How do Retail and Shopify platforms compare in monthly sales?**
5. **What percentage of sales is contributed by different demographics?**
6. **Which age and demographic groups contribute the most to Retail sales?**
---
## π§Ή Data Cleaning Highlights
- Replaced missing values in the `segment` column with `'Unknown'`
- Derived new columns:
- `week_number`, `month_number`, `calendar_year` from `week_date`
- `age_band` using `RIGHT(segment, 1)`
- `demographic` using `LEFT(segment, 1)`
- Created a `clean_weekly_sales` table with cleaned and enriched data
- Calculated average transaction value per row
---
## βοΈ SQL Concepts Used
- `CASE` statements for classification and segmentation
- String functions like `LEFT()`, `RIGHT()`
- Date functions like `WEEK()`, `MONTH()`, `YEAR()`
- Aggregations (`SUM()`, `GROUP BY`)
- Common Table Expressions (CTEs)
- Window functions (`OVER(PARTITION BY ...)`)
- NULL handling and derived metrics
---
## π How to Run This Project
1. Open **MySQL Workbench**
2. Run the file `01_create_and_load_weekly_sales.sql`
β This will create the base table and load data
3. Run the file `02_weekly_sales_analysis.sql`
β This will create a cleaned table and perform all analysis queries
4. Explore the results from each query block
---
## π§βπ» About Me
I'm an aspiring **Data Analyst** with skills in:
- SQL and relational database systems
- Business logic and metrics interpretation
- Data cleaning and reporting
- End-to-end problem solving using structured query language
This project is one of the ways I showcase my practical understanding of real-world sales data analytics.
---