Uncovering customer behavior, sales trends, and product performance through advanced SQL and Power BI.
An in-depth analysis of e-commerce data using Python, SQL, and Power BI. By utilizing advanced SQL queries for detailed analysis and creating an interactive Power BI dashboard, this project uncovers valuable insights into customer behavior, sales trends, and product performance.
Inspired by the Target Dataset on Kaggle, which includes essential data about products, sales, and customer demographics.
- Dataset
- Project Structure
- Project Workflow
- Data Preparation
- SQL Analysis
- Power BI Dashboard
- Technologies Used
- Getting Started
- Conclusion
The dataset consists of multiple files detailing products, transactions, and customer information, located in the market_data_extracts/ folder.
| File | Description |
|---|---|
commercial_transactions.csv |
Core transaction records across all sales channels |
fulfillment_records.csv |
Order fulfillment and shipping details |
market_demographics.csv |
Customer demographic and segmentation data |
regional_spatial_data.csv |
Geographic and regional mapping data |
sku_catalog.csv |
Product catalog with SKU-level details |
transaction_line_items.csv |
Granular line-item breakdown per transaction |
vendor_network.csv |
Vendor and supplier relationship data |
COMMERCIAL-SALES-MARKET-DYNAMICS/
│
├── assets/
│ └── Schema.png # Database schema diagram
│
├── commercial_data_modeling/ # SQL analysis scripts
│ ├── aggregate_regional_revenue.sql # Regional revenue aggregation
│ ├── build_market_dynamics_matrix.sql # Market dynamics and trend matrix
│ ├── calc_cumulative_commercial_sales.sql# Cumulative sales calculations
│ └── extract_vendor_metrics.sql # Vendor performance metrics
│
├── executive_reporting/ # Power BI dashboard assets
│ ├── Market_Overview_View.png # Dashboard page 1 screenshot
│ └── Regional_Performance_View.png # Dashboard page 2 screenshot
│
├── market_data_extracts/ # Raw dataset (CSV files)
│ ├── commercial_transactions.csv
│ ├── fulfillment_records.csv
│ ├── market_demographics.csv
│ ├── regional_spatial_data.csv
│ ├── sku_catalog.csv
│ ├── transaction_line_items.csv
│ └── vendor_network.csv
│
├── commercial_dashboard_app.py # Python dashboard application
├── etl_pipeline_ingestion.py # ETL pipeline for data ingestion
├── exploratory_market_analysis.ipynb # Jupyter notebook for EDA
└── README.md
|
Converted CSV files to SQL format, enabling efficient querying and data manipulation. |
Executed complex SQL queries to derive insights on e-commerce metrics such as top-selling products, customer purchasing patterns, and sales trends. |
Created a Power BI dashboard for intuitive, interactive exploration of the insights obtained from the data. |
Raw CSV files from market_data_extracts/ were ingested and converted into SQL tables using the etl_pipeline_ingestion.py pipeline. This involved:
- Loading data into SQL-compatible formats
- Cleaning and transforming data to ensure consistency and accuracy in analysis
Advanced SQL queries in the commercial_data_modeling/ folder provided insights into 4 key business areas:
| File | Analysis | Description |
|---|---|---|
aggregate_regional_revenue.sql |
Regional Revenue | Evaluated revenue by region for targeted growth |
build_market_dynamics_matrix.sql |
Market Dynamics | Analyzed seasonal and annual sales patterns and customer segmentation |
calc_cumulative_commercial_sales.sql |
Cumulative Sales | Identified bestsellers by revenue and assessed retention rates |
extract_vendor_metrics.sql |
Vendor Metrics | Measured discount effects, shipping timeliness, and return rates |
The Power BI dashboard provides a user-friendly, interactive experience enabling users to:
- View key performance indicators (KPIs) and metrics at a glance
- Filter data by product category, time period, and region
- Understand trends and patterns intuitively through rich visualizations
|
|
| Technology | Purpose |
|---|---|
| Python | Data cleaning and conversion of CSV files to SQL format |
| SQL | Advanced querying for in-depth data analysis |
| Power BI | Dynamic dashboard to visualize analysis results |
Step 1 — Clone the repository to your local machine.
git clone https://github.com/Acelake123/Commercial-Sales-Market-Dynamics.gitStep 2 — Run the ETL pipeline to ingest the raw CSV files from market_data_extracts/ into your SQL environment.
python etl_pipeline_ingestion.pyStep 3 — Use the SQL scripts in commercial_data_modeling/ to recreate the insights in a SQL environment.
Step 4 — (Optional) Open exploratory_market_analysis.ipynb to explore the data interactively via Jupyter Notebook.
This project demonstrates a comprehensive data analysis workflow using SQL for advanced querying and Power BI for visualization. The insights derived can aid in making data-driven decisions, improving customer targeting, and optimizing product and inventory management.
Built with Python, SQL & Power BI | Acelake123


