An SQL-based data analytics project focused on analyzing restaurant sales, customer behavior, revenue trends, and menu performance using real-world restaurant order data.
The analysis was performed using SQL Server Management Studio (SSMS) connected with Visual Studio Code. Query outputs and insights were later visualized with the help of ChatGPT-generated graphs and charts.
- SQL
- SQL Server Management Studio (SSMS)
- Visual Studio Code
- Git & GitHub
- CSV Dataset
- SQL-driven business analysis
- Revenue and sales trend exploration
- Restaurant performance comparison
- Customer ordering behavior analysis
- Menu item popularity tracking
- Query-based business problem solving
- Data aggregation and JOIN operations
- ChatGPT-generated visualizations from SQL outputs
I wanted to create a project that focused more on solving real business questions using SQL rather than only building dashboards. The goal was to understand restaurant sales data and extract meaningful insights from raw datasets.
I imported multiple restaurant-related datasets into SQL Server and connected SSMS with VS Code to write and execute queries. Each SQL file from Q1 to Q10 explores different business problems related to revenue, customer behavior, restaurants, and menu items.
After generating insights from SQL queries, I used ChatGPT to help visualize the outputs into graphs and charts for better presentation and storytelling.
This project helped me improve my SQL skills, analytical thinking, and understanding of how businesses use data to make decisions.
- Which restaurants generate the highest revenue?
- What are the top-selling menu items?
- Which days and times receive the most orders?
- Which customers place the most orders?
- Is revenue concentrated among a few restaurants/items?
- What are the busiest ordering periods?
- Which menu categories perform the best?
- What trends can be identified from customer orders?
- Certain restaurants contributed a major portion of total revenue
- A small number of menu items generated most sales
- Peak ordering times were concentrated during specific hours
- Customer ordering behavior showed repeat purchase patterns
- Revenue distribution highlighted business concentration trends
- Writing complex SQL queries using CTEs and JOINs
- Using aggregate functions for business analysis
- Structuring analytical SQL projects properly
- Solving real-world business problems with SQL
- Translating raw data into meaningful insights
- Improving analytical and problem-solving skills
- customers_medium
- orders_medium
- order_items
- restaurants
- restaurants_name
- menu_items
- menu_items_name
- Q1.sql β Revenue analysis
- Q2.sql β Restaurant performance insights
- Q3.sql β Customer behavior analysis
- Q4.sql β Menu item analysis
- Q5.sql β Sales trend exploration
- Q6βQ10.sql β Additional business insights and analysis
- Import the CSV datasets into SQL Server
- Open the SQL files in VS Code or SSMS
- Run each query individually
- Analyze the outputs and generated insights
- Use the query results for visualization or reporting
- SQL Querying
- JOIN Operations
- Common Table Expressions (CTEs)
- Data Aggregation
- Business Analysis
- Data Exploration
- Problem Solving
- Analytical Thinking
- Data Storytelling
Each query for this project focused on solving real-world restaurant business problems using SQL. The goal was to analyze restaurant sales, customer behavior, ordering patterns, and revenue trends to uncover actionable insights.
To identify the restaurants generating the highest revenue, I joined order data with restaurant datasets and calculated total revenue using menu item prices and quantities sold.
SELECT
restaurants.restaurant_id,
SUM(menu_items.price * order_items.quantity) AS total_revenue
FROM order_items
JOIN orders_medium
ON order_items.order_id = orders_medium.order_id
JOIN menu_items
ON order_items.menu_item_id = menu_items.menu_item_id
JOIN restaurants
ON orders_medium.restaurant_id = restaurants.restaurant_id
GROUP BY restaurants.restaurant_id
ORDER BY total_revenue DESC;Here's the breakdown of the top-performing restaurants:
- Street Spice Corner generated the highest revenue among all restaurants, making it the strongest overall performer.
- The Tasty Table and Sizzling Bites also contributed significantly to total revenue, showing strong customer demand.
- Revenue distribution was concentrated among a few restaurants, indicating that certain outlets dominated sales performance.
- Lower-performing restaurants still maintained steady revenue, suggesting stable customer traffic across the platform.
Bar graph visualizing the top 20 restaurants by revenue; ChatGPT generated this graph using SQL query outputs.
This query analyzed which menu items were ordered the most across all restaurants.
SELECT
menu_items_name.item_name,
SUM(order_items.quantity) AS total_orders
FROM order_items
JOIN menu_items_name
ON order_items.menu_item_id = menu_items_name.menu_item_id
GROUP BY menu_items_name.item_name
ORDER BY total_orders DESC;Here's the breakdown of the most popular menu items:
- Certain menu items consistently dominated customer orders, showing strong customer preference patterns.
- High-performing dishes contributed heavily to restaurant revenue and repeat purchases.
- Popularity trends suggested that affordable and frequently ordered items drove overall sales volume.
Bar graph visualizing the most ordered menu items; ChatGPT generated this graph from SQL outputs.
This query explored whether restaurant revenue was concentrated among a few restaurants or distributed evenly.
SELECT
restaurants.restaurant_id,
SUM(menu_items.price * order_items.quantity) AS revenue
FROM order_items
JOIN orders_medium
ON order_items.order_id = orders_medium.order_id
JOIN menu_items
ON order_items.menu_item_id = menu_items.menu_item_id
JOIN restaurants
ON orders_medium.restaurant_id = restaurants.restaurant_id
GROUP BY restaurants.restaurant_id
ORDER BY revenue DESC;Here's the breakdown of the revenue distribution:
- A small group of restaurants contributed a major portion of total sales.
- Revenue gaps between restaurants highlighted differences in customer demand and order volume.
- Top-performing restaurants likely benefited from stronger menu offerings, customer retention, or pricing strategies.
Revenue distribution graph generated using SQL query results.
This query identified customers who placed the highest number of orders.
SELECT
customer_id,
COUNT(order_id) AS total_orders
FROM orders_medium
GROUP BY customer_id
ORDER BY total_orders DESC;Here's the breakdown of customer behavior insights:
- Certain customers placed significantly more orders than others, showing repeat purchase behavior.
- Repeat customers likely contributed strongly to consistent restaurant revenue.
- Order frequency patterns indicated opportunities for loyalty or retention programs.
Graph visualizing customer ordering patterns generated from SQL outputs.
This query analyzed which days generated the highest order activity across restaurants.
SELECT
DATENAME(WEEKDAY, order_time) AS order_day,
COUNT(order_id) AS total_orders
FROM orders_medium
GROUP BY DATENAME(WEEKDAY, order_time)
ORDER BY total_orders DESC;Here's the breakdown of ordering trends:
- Sunday recorded the highest number of orders with 766 total orders, making it the busiest day overall.
- Tuesday and Saturday also showed strong customer activity, with 743 and 739 orders respectively.
- Order activity remained relatively consistent throughout the week, indicating stable customer demand across different days.
- Higher weekend order volumes suggest increased customer engagement during leisure periods.
- Understanding peak ordering days can help restaurants optimize staffing, inventory management, and delivery operations.
| Order Day | Total Orders |
|---|---|
| Sunday | 766 |
| Tuesday | 743 |
| Saturday | 739 |
| Thursday | 700 |
| Wednesday | 697 |
Bar graph visualizing busiest ordering days generated using SQL query outputs.
Additional queries from Q6βQ10 explored broader business trends across restaurants, orders, and menu performance.
Key findings included:
- Revenue concentration among top restaurants
- Strong demand for specific menu categories
- Customer repeat-order behavior
- Sales fluctuations across time periods
- Menu items contributing disproportionately to revenue
These analyses helped simulate how businesses use SQL to answer operational and strategic questions using raw transactional data.