This project presents a comprehensive data analysis of Swiggy sales data using Microsoft SQL Server. The goal is to derive actionable business insights by processing raw sales data through a structured pipeline: from data cleaning and validation to dimensional modeling and advanced business analytics, with optional visualization in Tableau.
SWIGGY_SALES_ANALYSIS
│
├── IMAGES /
│
├── 1_data_cleaning_and_validation.SQL
├── 2_create_star_schema.SQL
├── 3_KPIS.SQL
├── 4_Business_Analysis.SQL
│
├── data.csv
├── README.md
├── LICENSE
The analysis is based on the data.csv file, which includes detailed transaction records.
| Column | Description |
|---|---|
| State | State where the order was placed |
| City | City of the transaction |
| Order Date | Date the order was placed |
| Restaurant Name | Name of the restaurant |
| Location | Specific locality/area |
| Category | Food category (e.g., Snack, Recommended) |
| Dish Name | Name of the item ordered |
| Price (INR) | Cost of the item |
| Rating | Customer rating for the order |
| Rating Count | Count of ratings received |
Script: 1_data_cleaning_and_validation.SQL
- NULL checks
- Empty string checks
- Duplicate detection
- Duplicate removal (if applicable)
The project follows a Star Schema architectural pattern to optimize for analytical queries.
| Star Schema |
|---|
![]() |
erDiagram
Fact_Order {
int order_ID PK
int date_ID FK
int location_ID FK
int restaurent_ID FK
int catagory_ID FK
int dish_ID FK
decimal price_INR
decimal rating
int rating_count
}
Dim_Date {
int date_ID PK
date full_date
int day
int week
int month
int quater
int year
varchar month_name
}
Dim_Location {
int location_ID PK
varchar state
varchar city
varchar location
}
Dim_Restaurant {
int restaurant_ID PK
varchar restaurent_name
}
Dim_Catagory {
int catagory_ID PK
varchar catagory
}
Dim_Dish {
int dish_ID PK
varchar dish_name
}
Fact_Order }|..|| Dim_Date : date_ID
Fact_Order }|..|| Dim_Location : location_ID
Fact_Order }|..|| Dim_Restaurant : restaurent_ID
Fact_Order }|..|| Dim_Catagory : catagory_ID
Fact_Order }|..|| Dim_Dish : dish_ID
- Fact table:
Fact_Order: contains measures likeprice_INR,rating,rating_count
- Dimension tables:
Dim_Date: temporal attributes (year, month, quarter)Dim_Location: geography (state, city, location)Dim_Restaurant: restaurant masterDim_Catagory: category masterDim_Dish: dish master
Total Orders- Count of all orders placedTotal Revenue (₹-M)- Gross Merchandise Value (GMV) in INR MillionAverage Order Value (AOV)- Revenue per orderOrders per Day- Daily order volume trendsOrders per Quarter- Quarterly order distributionOrders per Month- Monthly order patternsRevenue by Month- Monthly revenue breakdown (base for growth metrics)Month-over-Month (MoM) Revenue Growth %- Monthly revenue change percentageQuarter-over-Quarter (QoQ) Revenue Growth %- Quarterly revenue change percentage
Orders by Location (State / City)- Order distribution across geographyRevenue by State / City- Geographic revenue breakdownAverage Order Value (AOV) by Location- Location-wise spending patternsLocation Revenue Contribution %- Each location's share of total revenueTop 10 Performing Cities (by Revenue)- Best performing marketsBottom 10 Performing Cities (by Revenue)- Underperforming markets requiring attention
Orders per Restaurant- Order volume by restaurantRevenue per Restaurant- Restaurant-wise revenue generationAvg Revenue per Order per Restaurant (AOV)- Restaurant-specific order valueTop 10 Restaurants' Share of Total Revenue- Revenue concentration metric
Orders by Category- Order distribution across food categoriesRevenue by Category- Category-wise revenue contributionCategory Mix %- Percentage breakdown of revenue by categoryAvg Price per Category (AOV by Category)- Category-specific pricing insights
See 3_KPIS.SQL for detailed query implementations.
Questions are listed in 4_Business_Analysis.SQL (fill in your findings below as you analyze).
-
Which cities consistently outperform and deserve expansion budget?-
Ans : Cities like Bengaluru, Lucknow, Hyderabad, and Mumbai are performing well every month and bringing in high revenue, so they are good choices for expanding the business. On the other hand, cities like Panaji and Lucknow have higher average order values, which means customers there are willing to spend more, making these cities suitable for premium and high-margin offerings.
-
Query Result 
-
-
Are we over-dependent on a few restaurants? -
Which dishes are overpriced for demand? -
When should operations scale up or down? -
Weekend vs Weekday Behavior
- Microsoft SQL Server
- SQL client: SSMS or Azure Data Studio
- (Optional) Tableau for visualization
- Import
data.csvinto SQL Server (staging table expected asdbo.[swiggy data]). - Run
1_data_cleaning_and_validation.SQL. - Run
2_create_star_schema.SQLto create dimensions + fact table and load data. - Run
3_KPIS.SQLfor KPI outputs. - Run
4_Business_Analysis.SQLto answer business questions.
- Database: Microsoft SQL Server
- Language: T-SQL
- Concepts: Data Cleaning, Normalization, Star Schema, Aggregation, Window Functions, CTE (Common Table Expression)
This project is licensed under the MIT License - see the LICENSE file for details.
Project Maintainer: [Rupam Mondal]
Project Link: LINK





