Skip to content

Repository files navigation

🍕 Pizza Sales Analysis Using SQL

📌 Project Overview

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.


🛠️ Tools & Technologies

  • MySQL
  • MySQL Workbench
  • SQL

📂 Database Structure

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

📊 Business Questions

🟢 Basic Analysis

  1. Calculate the total revenue generated from pizza sales.
  2. Identify the highest-priced pizza.
  3. Identify the most common pizza size ordered.
  4. List the top 5 most ordered pizza types along with their quantities.

🟡 Intermediate Analysis

  1. Find the total quantity of each pizza category ordered.
  2. Determine the distribution of orders by hour of the day.
  3. Find the category-wise distribution of pizzas.
  4. Group the orders by date and calculate the average number of pizzas ordered per day.
  5. Determine the top 3 most ordered pizza types based on revenue.

🔴 Advanced Analysis

  1. Calculate the percentage contribution of each pizza category to total revenue.
  2. Analyze the cumulative revenue generated over time.
  3. Determine the top 3 pizza types based on revenue for each pizza category.

🧠 SQL Concepts Used

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

📈 Key Insights

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.

Revenue Contribution by Category

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%.


🎯 Project Objective

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

📁 Project File

The complete SQL queries used for the analysis are available in the SQL file included in this repository.


🚀 Skills Demonstrated

SQL MySQL Data Analysis Data Aggregation Joins Subqueries Window Functions Business Analysis


👤 Author

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.

About

Pizza Sales Analysis using MySQL to answer business questions ranging from basic to advanced SQL, including joins, subqueries, aggregations, revenue analysis, and window functions.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors