This project is a part of my learning journey to master SQL. The objective was to analyze pizza sales data and answer various questions ranging from basic to advanced complexity. The dataset and questions are sourced from this GitHub repository.
The project is divided into three sections:
- Basic Questions: 5 questions that cover fundamental SQL queries.
- Intermediate Questions: 5 questions that delve into more complex SQL operations.
- Advanced Questions: 3 questions that require advanced SQL techniques.
- Understand and practice basic SQL operations.
- Learn to write more complex SQL queries.
- Optimize SQL queries for better performance.
- Apply advanced SQL techniques to solve intricate problems.
- Dataset and Questions: I used the dataset and questions from Ayushi0214/pizza-sales---SQL.
- Writing SQL Queries: I initially wrote all the SQL queries myself to answer the provided questions.
- Optimization: I then optimized these queries with the assistance of ChatGPT, ensuring they are efficient and clean.
- Retrieve the total number of orders placed.
- 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.
- Join the necessary tables to find the total quantity of each pizza category ordered.
- Determine the distribution of orders by hour of the day.
- Join relevant tables to 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 type to total revenue.
- Analyze the cumulative revenue generated over time.
- Determine the top 3 most ordered pizza types based on revenue for each pizza category.
This project was an excellent opportunity for me to practice and enhance my SQL skills. The process of writing and optimizing queries has deepened my understanding of SQL and prepared me for more advanced data analysis tasks.
Feel free to explore the queries and provide any feedback or suggestions!