Skip to content

SQL-based Coffee Sales Analysis project using real-world sales, customer, and city data. Extracts key business insights, evaluates market potential, and ranks cities for expansion using advanced SQL queries in SSMS.

Notifications You must be signed in to change notification settings

razamuhamadrazi/SQL-Coffee-Sales-Insights

Repository files navigation

β˜• Coffee Sales Analysis - SQL Project

πŸ“Œ Overview

This project focuses on analyzing coffee sales data using SQL. It involves creating a structured database, importing datasets, performing data cleaning, and generating insightful reports. The analysis helps in understanding sales trends, customer segmentation, and revenue patterns across different cities.

πŸ“‚ Dataset

The dataset consists of four CSV files:

  • sales.csv – Contains sales transactions with details like date, customer ID, product ID, and total amount.
  • customers.csv – Includes customer information such as customer ID and city association.
  • products.csv – Lists coffee products with their respective prices.
  • cities.csv – Provides city-level details including population, estimated rent, and city ranking.

πŸ› οΈ Steps Performed

1️⃣ Database Creation & Data Import

  • Created a coffee_sales database in SQL Server.
  • Imported the four CSV files into respective tables (sales, customers, products, cities).

2️⃣ Data Cleaning & Validation

  • Checked for missing values in each table to ensure data consistency.
  • Verified foreign key relationships between tables for accuracy.

3️⃣ Exploratory Data Analysis (EDA)

  • Analyzed coffee consumption based on city population.
  • Examined total sales revenue and revenue breakdown by city.
  • Identified best-selling coffee products.

4️⃣ Key Business Insights

  • Top Revenue-Generating Cities – Identified cities contributing the most to sales.
  • Customer Behavior – Analyzed unique customer count per city.
  • Market Potential – Evaluated estimated coffee consumers vs. actual buyers.
  • Sales vs. Rent Analysis – Compared sales revenue with average rent per customer.
  • Monthly Growth Trends – Tracked revenue growth across different months.

πŸ“‘ Business Recommendation Report

Based on SQL analysis, the following cities are the best for business expansion:

πŸ™οΈ City 1: Pune

βœ… Lowest average rent per customer, increasing affordability.
βœ… Highest total revenue, making it a strong market.
βœ… High average sales per customer, indicating a profitable audience.

πŸ™οΈ City 2: Delhi

βœ… Largest estimated coffee consumer base (7.7 million people).
βœ… Highest total number of customers (68 buyers).
βœ… Moderate rent per customer (330), still within an acceptable range.

πŸ™οΈ City 3: Jaipur

βœ… Highest customer count (69 customers).
βœ… Extremely low average rent per customer (156), maximizing profit margins.
βœ… Better-than-average sales per customer (11.6k revenue per buyer).

πŸ”Ή Recommendation: Pune is the best city to focus on due to its strong revenue potential and customer affordability. Delhi has the largest market size, while Jaipur offers high engagement at lower costs.

πŸ“Š SQL Queries

All SQL queries used in this project are documented in Coffee_Sales_Analysis.sql, covering:
βœ… Data Exploration
βœ… Revenue & Product Sales Analysis
βœ… Customer Segmentation
βœ… Monthly Sales Growth Trends
βœ… Market Potential Evaluation

πŸ“Œ How to Use

1️⃣ Download or clone this repository.
2️⃣ Import the dataset into SQL Server.
3️⃣ Run Coffee_Sales_Analysis.sql to generate insights.
4️⃣ Review the business report above for recommendations.
5️⃣ Modify queries as needed for custom analysis.

πŸš€ Future Enhancements

  • Expanding analysis to include customer loyalty and purchase frequency.
  • Integrating Power BI for advanced visualizations.
  • Predictive modeling for future sales trends.

About

SQL-based Coffee Sales Analysis project using real-world sales, customer, and city data. Extracts key business insights, evaluates market potential, and ranks cities for expansion using advanced SQL queries in SSMS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published