Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🍽️ Food Delivery Data Analysis using SQL

📖 Project Overview

This project analyzes a Food Delivery Platform database using SQL to uncover valuable business insights related to customers, restaurants, menu items, orders, revenue, and delivery performance.

The project demonstrates practical SQL skills frequently used by Data Analysts, including data exploration, joins, subqueries, views, window functions, and business reporting.


📂 Dataset

The project uses four relational tables.

Table Description
Customers Customer demographics
Restaurants Restaurant information
Menu Menu items and pricing
Orders Order transactions and delivery details

Database Schema

Customers
---------
cid
cname
age
gender

Restaurants
------------
res_id
res_name
city
location

Menu
------
menu_id
res_id
item_name
veg_nonveg
res_price
app_price

Orders
--------
order_id
menu_id
cust_id
qty
order_date
order_time
eta
delivery_time

🎯 Project Objectives

  • Explore the database
  • Analyze customer ordering behaviour
  • Measure restaurant performance
  • Evaluate delivery efficiency
  • Perform pricing analysis
  • Generate business insights using SQL

🛠️ Technologies Used

  • MySQL
  • MySQL Workbench
  • SQL

📚 SQL Concepts Demonstrated

Basic SQL

  • SELECT
  • WHERE
  • ORDER BY
  • GROUP BY
  • HAVING
  • DISTINCT
  • LIMIT

Aggregate Functions

  • COUNT()
  • SUM()
  • AVG()
  • MIN()
  • MAX()

Joins

  • INNER JOIN
  • LEFT JOIN

Conditional Logic

  • CASE WHEN

Date & Time Functions

  • MONTH()
  • YEAR()
  • TIMEDIFF()
  • MINUTE()
  • DATEDIFF()

Advanced SQL

  • Subqueries
  • Views
  • Window Functions
  • Ranking Functions
  • LEAD()
  • DENSE_RANK()
  • SUM() OVER()
  • AVG() OVER()

📊 Business Problems Solved

Exploratory Data Analysis

  • Total number of orders
  • Dataset exploration
  • Understanding database relationships

Customer Analysis

  • Top 5 customers by quantity ordered
  • Customers with multiple orders
  • Customers ordering from multiple restaurants
  • Customers spending above gender average
  • Latest order of every customer
  • Customers with consecutive-day orders
  • Preferred restaurant of each customer

Restaurant Analysis

  • Restaurants with highest orders
  • Restaurant revenue analysis
  • Restaurants performing above average revenue
  • Revenue contribution of each restaurant
  • Average delivery delay per restaurant

Menu Analysis

  • Most expensive item in every restaurant
  • Menu items never ordered
  • Top ordered items per restaurant
  • Bottom ordered items overall
  • Menu items where app price exceeds restaurant price

Sales Analysis

  • Monthly revenue
  • Running monthly revenue
  • Customer spending
  • Restaurant revenue comparison

📈 Key SQL Features Used

  • Aggregate Analysis
  • Multi-table Joins
  • Nested Subqueries
  • Views
  • Window Functions
  • Ranking
  • Running Totals
  • Business KPIs

📁 Project Structure

Food-Delivery-SQL-Analysis
│
├── Dataset
│   ├── customers.csv
│   ├── restaurants.csv
│   ├── menu.csv
│   └── orders.csv
│
├── SQL Scripts
│   ├── EDA.sql
│   └── Advance_Analysis.sql
│
│
└── README.md

🚀 How to Run

Step 1

Clone the repository.

git clone https://github.com/yourusername/Food-Delivery-SQL-Analysis.git

Step 2

Create the database.

CREATE DATABASE IM_Project;
USE IM_Project;

Step 3

Import the CSV files into MySQL.

  • customers.csv
  • restaurants.csv
  • menu.csv
  • orders.csv

Step 4

Run the SQL scripts in the following order:

  1. EDA.sql
  2. Advance_Analysis.sql

💡 Business Insights Generated

  • Identify high-value customers
  • Measure restaurant performance
  • Analyze customer purchasing behaviour
  • Detect pricing differences between restaurants and app listings
  • Track monthly revenue trends
  • Evaluate delivery delays
  • Discover customer preferences
  • Measure restaurant contribution to total revenue

🎓 Skills Demonstrated

  • SQL Query Writing
  • Relational Database Analysis
  • Business Intelligence
  • Customer Analytics
  • Revenue Analysis
  • Window Functions
  • Data Exploration
  • Advanced SQL Problem Solving

👨‍💻 Author

Aryan Shahi

Aspiring Data Analyst

Skills

  • SQL
  • Python
  • Power BI
  • Excel
  • Statistics

Connect with me on LinkedIn and GitHub.


⭐ If you found this project useful, consider giving it a star!

About

End-to-end SQL analysis of a Food Delivery database using MySQL, covering EDA, joins, subqueries, CTEs, window functions, and business insights for data-driven decision-making.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors