This project focuses on analyzing pizza sales data using MySQL to extract meaningful business insights.
The analysis covers Basic, Intermediate, and Advanced SQL queries, including revenue analysis, order trends, pizza category performance, and product rankings.
The main objective of this project is to apply SQL concepts to a real-world sales dataset and answer important business questions.
- MySQL
- MySQL Workbench
- SQL
The project uses four main tables:
| Table | Description |
|---|---|
orders |
Contains order ID, date, and time |
order_details |
Contains pizza quantities for each order |
pizzas |
Contains pizza size and price information |
pizza_types |
Contains pizza name, category, and ingredients |
- Calculate the total revenue generated from pizza sales.
- Identify the highest-priced pizza.
- Identify the most common pizza size ordered.
- List the top 5 most ordered pizza types along with their quantities.
- Find the total quantity of each pizza category ordered.
- Determine the distribution of orders by hour of the day.
- Find the category-wise distribution of pizzas.
- Group the orders by date and calculate the average number of pizzas ordered per day.
- Determine the top 3 most ordered pizza types based on revenue.
- Calculate the percentage contribution of each pizza category to total revenue.
- Analyze the cumulative revenue generated over time.
- Determine the top 3 pizza types based on revenue for each pizza category.
This project demonstrates the use of:
- SELECT statements
- WHERE clauses
- ORDER BY
- GROUP BY
- Aggregate Functions (
SUM,COUNT,AVG) - Multiple Table JOINs
- Subqueries
- Date and Time Functions
- Window Functions
RANK()PARTITION BY- Cumulative SUM
Some of the key insights obtained from the analysis include:
- Identification of the highest revenue-generating pizza categories.
- Identification of the most frequently ordered pizza sizes and types.
- Analysis of order patterns based on the hour of the day.
- Comparison of revenue contribution across different pizza categories.
- Identification of top-performing pizzas based on revenue.
- Analysis of cumulative revenue over time.
| Pizza Category | Revenue Contribution |
|---|---|
| Classic | 26.91% |
| Supreme | 25.46% |
| Chicken | 23.96% |
| Veggie | 23.68% |
Classic pizzas contributed the highest share of total revenue at approximately 26.91%.
The objective of this project was to strengthen my SQL and data analysis skills by working with a relational sales database and solving business-oriented problems.
Through this project, I gained hands-on experience in:
- Querying relational databases
- Joining multiple tables
- Performing sales and revenue analysis
- Using aggregate functions
- Writing subqueries
- Applying window functions
- Converting raw sales data into meaningful business insights
The complete SQL queries used for the analysis are available in the SQL file included in this repository.
SQL MySQL Data Analysis Data Aggregation Joins Subqueries Window Functions Business Analysis
Yashraj Mithari
Aspiring Data Analyst | SQL | Excel | Power BI | Python
⭐ If you found this project useful, feel free to explore the SQL queries in this repository.