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.
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.
- Created a
coffee_sales
database in SQL Server. - Imported the four CSV files into respective tables (
sales
,customers
,products
,cities
).
- Checked for missing values in each table to ensure data consistency.
- Verified foreign key relationships between tables for accuracy.
- Analyzed coffee consumption based on city population.
- Examined total sales revenue and revenue breakdown by city.
- Identified best-selling coffee products.
- 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.
Based on SQL analysis, the following cities are the best for business expansion:
β
Lowest average rent per customer, increasing affordability.
β
Highest total revenue, making it a strong market.
β
High average sales per customer, indicating a profitable audience.
β
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.
β
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.
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
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.
- Expanding analysis to include customer loyalty and purchase frequency.
- Integrating Power BI for advanced visualizations.
- Predictive modeling for future sales trends.