Restaurant-orders-data-analysis-using-SQL

🍽️ Restaurant Orders Data Analysis (SQL)

Project Overview

This project analyzes restaurant order data using SQL to uncover insights about customer ordering behavior, menu performance, and revenue trends.

The objective of this analysis is to answer key business questions that can help a restaurant improve decision-making around:

The analysis is performed using SQL queries on two relational tables: menu_items and order_details.


📂 Dataset Description

1. menu_items

This table contains details about the restaurant’s menu items.

Column Description
menu_item_id Unique identifier for each menu item
item_name Name of the menu item
category Cuisine or food category
price Price of the item

2. order_details

This table contains transaction-level information about customer orders.

Column Description
order_details_id Unique ID for each record
order_id Unique identifier for each order
order_time Time the order was placed
item_id ID linking the order to a menu item

🔎 Business Questions, Analysis & Insights

1️⃣ What are the most and least ordered items?

SELECT m.item_name,
       COUNT(o.order_details_id) AS ordercount,
       m.category
FROM menu_items m, order_details o
GROUP BY m.item_name, m.category
ORDER BY ordercount DESC;

Analysis

This query counts how many times each menu item appears in customer orders.

Insights


💰 2️⃣ What do the highest spend orders look like?

SELECT m.item_name,
       m.category,
       SUM(m.price) AS sales,
       o.order_id
FROM menu_items m, order_details o
GROUP BY m.item_name, m.category, o.order_id
ORDER BY sales DESC
LIMIT 10;

Analysis

This query calculates the total value of items purchased within each order.

Insights


⏰ 3️⃣ Are there certain times that have more or fewer orders?

SELECT COUNT(o.order_details_id) AS ordercount,
       EXTRACT(HOUR FROM o.order_time) AS time
FROM order_details o
GROUP BY time
ORDER BY ordercount DESC;

Analysis

This query extracts the hour from each order time and counts the number of orders placed during each hour.

Insights


🍜 Which cuisines should the restaurant focus on developing more menu items for?

SELECT m.item_name,
       m.category,
       SUM(m.price) AS sales,
       COUNT(o.order_details_id) AS ordercount
FROM menu_items m, order_details o
GROUP BY item_name, category, order_id
ORDER BY sales DESC;

Analysis

This query measures both total revenue generated and order frequency for menu items.

Insights


🕒 What time does the restaurant make the most sales?

SELECT EXTRACT(HOUR FROM order_time) AS time,
       SUM(m.price) AS sales
FROM order_details o, menu_items m
GROUP BY time
ORDER BY sales DESC;

Analysis

This query calculates the total revenue generated during each hour of the day.

Insights


🧠 SQL Skills Demonstrated

This project demonstrates several SQL concepts including:


🚀 How to Run This Project

  1. Clone the repository
git clone  https://safiyah-abiala.github.io/Restaurant-orders-data-analysis-using-SQL/
  1. Import the dataset into your SQL environment (PostgreSQL, MySQL, or any SQL client).

  2. Run the SQL queries provided in the project to reproduce the analysis.


📊 Project Outcome

Through SQL analysis of restaurant order data, this project demonstrates how raw transactional data can be transformed into actionable insights that support:


👩‍💻 Author

Ms_Safiyah