This project demonstrates an end-to-end business analytics workflow using SQL, SQLite, Python, Pandas, and Matplotlib. The goal is to analyze retail sales data, answer business questions using SQL, and create visualizations that support data-driven decision-making.
The project follows a real-world analytics workflow:
- Import retail sales data into a SQLite database.
- Analyze the data using SQL queries.
- Load SQL query results into Python with Pandas.
- Create visualizations using Matplotlib.
- Generate business insights and recommendations.
- Practice SQL for business analysis.
- Learn how SQL and Python work together.
- Perform exploratory data analysis (EDA).
- Build a GitHub-ready portfolio project.
- Present business insights through data visualization.
- Import and analyze sales data using SQLite.
- Execute SQL queries for business reporting.
- Integrate SQL results into Python.
- Analyze data using Pandas.
- Create professional visualizations using Matplotlib.
- Export analysis results as CSV files.
- Generate business recommendations from data.
- Python
- SQLite
- SQL
- Pandas
- Matplotlib
- Jupyter Notebook
Dataset: Sample Superstore
The dataset contains retail sales transactions including:
- Orders
- Customers
- Products
- Categories
- Regions
- Sales
- Profit
- Discounts
sql-python-business-analytics/
│
├── data/
├── database/
├── notebooks/
├── outputs/
├── images/
├── src/
├── README.md
├── requirements.txt
└── .gitignore
- Total Sales
- Total Profit
- Total Orders
- Average Order Value
- Profit Margin
- Sales by Category
- Profit by Category
- Profit Margin
- Sales by Region
- Regional Profitability
- Top Sales Customers
- Top Profit Customers
- Loss-Making Customers
- Top Sales Products
- Top Profit Products
- Loss-Making Products
- Monthly Sales Trends
- Yearly Sales Trends
- Technology generated the highest sales and overall profit.
- Furniture recorded high sales but the lowest profit margin.
- The West region achieved the highest sales performance.
- The Consumer segment generated the highest overall revenue.
- Some high-sales customers generated losses, indicating potential pricing or discount issues.
- Continue investing in high-performing Technology products.
- Improve Furniture profitability by reviewing pricing and discount strategies.
- Increase marketing efforts in lower-performing regions.
- Review pricing and discount policies for loss-making customers and products.
- SELECT
- WHERE
- GROUP BY
- ORDER BY
- COUNT()
- SUM()
- AVG()
- ROUND()
- LIMIT
- sqlite3
- Pandas
- DataFrames
- SQL Integration
- CSV Export
- Matplotlib Visualization
- KPI Reporting
- Customer Analysis
- Product Analysis
- Regional Analysis
- Trend Analysis
- Business Recommendations
Through this project, I learned how to:
- Store data in a SQLite database.
- Write SQL queries for business analysis.
- Connect Python with SQLite.
- Load SQL query results into Pandas.
- Create business visualizations using Matplotlib.
- Communicate insights through data analysis and recommendations.
- Build an interactive dashboard using Power BI.
- Explore advanced SQL concepts such as joins and window functions.
- Automate report generation.
- Extend the analysis with predictive analytics.
-
Clone this repository.
-
Create and activate a virtual environment.
-
Install the required packages:
pip install -r requirements.txt- Launch Jupyter Notebook:
jupyter notebook- Open:
notebooks/analysis.ipynb
- Run all cells to reproduce the analysis and visualizations.
Lena B
Aspiring Data Analyst | SQL | Python | Excel | Power BI



