{"id":23602775,"url":"https://github.com/hellymodikalpesh/sql-project-zomato-data-analysis","last_synced_at":"2026-02-10T22:33:48.902Z","repository":{"id":268685756,"uuid":"905155336","full_name":"HellyModiKalpesh/SQL-Project-Zomato-Data-Analysis","owner":"HellyModiKalpesh","description":"This project showcases my SQL expertise through a comprehensive analysis of Zomato's food delivery business. From database creation to solving complex business problems, this project highlights my ability to extract actionable insights using SQL.","archived":false,"fork":false,"pushed_at":"2024-12-18T09:46:19.000Z","size":557,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T17:48:55.499Z","etag":null,"topics":["sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HellyModiKalpesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-18T09:16:07.000Z","updated_at":"2024-12-18T09:46:35.000Z","dependencies_parsed_at":"2024-12-18T10:27:02.946Z","dependency_job_id":"39ddf32a-1364-4ac6-8baf-a72951f4a960","html_url":"https://github.com/HellyModiKalpesh/SQL-Project-Zomato-Data-Analysis","commit_stats":null,"previous_names":["hellymodikalpesh/sql-project-zomato-data-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HellyModiKalpesh/SQL-Project-Zomato-Data-Analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HellyModiKalpesh%2FSQL-Project-Zomato-Data-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HellyModiKalpesh%2FSQL-Project-Zomato-Data-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HellyModiKalpesh%2FSQL-Project-Zomato-Data-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HellyModiKalpesh%2FSQL-Project-Zomato-Data-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HellyModiKalpesh","download_url":"https://codeload.github.com/HellyModiKalpesh/SQL-Project-Zomato-Data-Analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HellyModiKalpesh%2FSQL-Project-Zomato-Data-Analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29319690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sql"],"created_at":"2024-12-27T12:13:07.962Z","updated_at":"2026-02-10T22:33:48.883Z","avatar_url":"https://github.com/HellyModiKalpesh.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL-Project-Zomato-Data-Analysis\n\nThis project showcases my SQL expertise through a comprehensive analysis of Zomato's food delivery business. From database creation to solving complex business problems, this project highlights my ability to extract actionable insights using SQL.\n\n![erd](https://github.com/user-attachments/assets/a5d293bd-86a7-4c98-9d1d-db71dd5d7542)\n\n## Project Structure\n\n- **Database Setup:** Creation of the `zomato_db` database and the required tables.\n- **Data Import:** Inserting sample data into the tables.\n- **Data Cleaning:** Handling null values and ensuring data integrity.\n- **Business Problems:** Solving 20 specific business problems using SQL queries.\n\n## Tables\n\n- **restaurants**: Information about restaurants (e.g., name, city, opening hours).\n- **customers**: Details of registered customers.\n- **riders**: Information about riders and sign-up dates.\n- **orders**: Tracks orders placed by customers, including status and amount.\n- **deliveries**: Delivery details, including rider and status.\n\n## Database Setup\n```sql\nCREATE DATABASE zomato_db;\n```\n\n### 1. Dropping Existing Tables\n```sql\nDROP TABLE IF EXISTS deliveries;\nDROP TABLE IF EXISTS Orders;\nDROP TABLE IF EXISTS customers;\nDROP TABLE IF EXISTS restaurants;\nDROP TABLE IF EXISTS riders;\n\n-- 2. Creating Tables\nCREATE TABLE restaurants (\n    restaurant_id SERIAL PRIMARY KEY,\n    restaurant_name VARCHAR(100) NOT NULL,\n    city VARCHAR(50),\n    opening_hours VARCHAR(50)\n);\n\nCREATE TABLE customers (\n    customer_id SERIAL PRIMARY KEY,\n    customer_name VARCHAR(100) NOT NULL,\n    reg_date DATE\n);\n\nCREATE TABLE riders (\n    rider_id SERIAL PRIMARY KEY,\n    rider_name VARCHAR(100) NOT NULL,\n    sign_up DATE\n);\n\nCREATE TABLE Orders (\n    order_id SERIAL PRIMARY KEY,\n    customer_id INT,\n    restaurant_id INT,\n    order_item VARCHAR(255),\n    order_date DATE NOT NULL,\n    order_time TIME NOT NULL,\n    order_status VARCHAR(20) DEFAULT 'Pending',\n    total_amount DECIMAL(10, 2) NOT NULL,\n    FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n    FOREIGN KEY (restaurant_id) REFERENCES restaurants(restaurant_id)\n);\n\nCREATE TABLE deliveries (\n    delivery_id SERIAL PRIMARY KEY,\n    order_id INT,\n    delivery_status VARCHAR(20) DEFAULT 'Pending',\n    delivery_time TIME,\n    rider_id INT,\n    FOREIGN KEY (order_id) REFERENCES Orders(order_id),\n    FOREIGN KEY (rider_id) REFERENCES riders(rider_id)\n);\n```\n\n## Data Cleaning and Handling Null Values\n\nBefore performing analysis, I ensured that the data was clean and free from null values where necessary. For instance:\n\n```sql\nUPDATE orders\nSET total_amount = COALESCE(total_amount, 0);\n```\n\n## Business Problems Solved\n\n### 1. Write a query to find the top 5 most frequently ordered dishes by customer called \"Arjun Mehta\" in the last 1 year.\n### 2. Popular Time Slots\n-- Question: Identify the time slots during which the most orders are placed. based on 2-hour intervals.\n### 3. Order Value Analysis\n-- Question: Find the average order value per customer who has placed more than 750 orders.\n-- Return customer_name, and aov(average order value)\n### 4. High-Value Customers\n-- Question: List the customers who have spent more than 100K in total on food orders.\n-- return customer_name, and customer_id!\n### 5. Orders Without Delivery\n-- Question: Write a query to find orders that were placed but not delivered. \n-- Return each restuarant name, city and number of not delivered orders\n### 6. Restaurant Revenue Ranking: \n-- Rank restaurants by their total revenue from the last year, including their name, \n-- total revenue, and rank within their city.\n### 7. Most Popular Dish by City: \n-- Identify the most popular dish in each city based on the number of orders.\n### 8. Customer Churn: \n-- Find customers who haven’t placed an order in 2024 but did in 2023.\n### 9. Cancellation Rate Comparison: \n-- Calculate and compare the order cancellation rate for each restaurant between the \n-- current year and the previous year.\n### 10. Rider Average Delivery Time: \n-- Determine each rider's average delivery time.\n### 11. Monthly Restaurant Growth Ratio: \n-- Calculate each restaurant's growth ratio based on the total number of delivered orders since its joining\n### 12. Customer Segmentation: \n-- Customer Segmentation: Segment customers into 'Gold' or 'Silver' groups based on their total spending \n-- compared to the average order value (AOV). If a customer's total spending exceeds the AOV, \n-- label them as 'Gold'; otherwise, label them as 'Silver'. Write an SQL query to determine each segment's \n-- total number of orders and total revenue\n### 13. Rider Monthly Earnings: \n-- Calculate each rider's total monthly earnings, assuming they earn 8% of the order amount.\n### Q.14 Rider Ratings Analysis: \n-- Find the number of 5-star, 4-star, and 3-star ratings each rider has.\n-- riders receive this rating based on delivery time.\n-- If orders are delivered less than 15 minutes of order received time the rider get 5 star rating,\n-- if they deliver 15 and 20 minute they get 4 star rating \n-- if they deliver after 20 minute they get 3 star rating.\n### 15. Q.15 Order Frequency by Day: \n-- Analyze order frequency per day of the week and identify the peak day for each restaurant.\n### 16. Customer Lifetime Value (CLV): \n-- Calculate the total revenue generated by each customer over all their orders.\n### 17. Monthly Sales Trends: \n-- Identify sales trends by comparing each month's total sales to the previous month\n### 18. Rider Efficiency: \n-- Evaluate rider efficiency by determining average delivery times and identifying those with the lowest and highest averages.\n### 19. Order Item Popularity: \n-- Track the popularity of specific order items over time and identify seasonal demand spikes.\n### 20. Rank each city based on the total revenue for last year 2023\n\n## Conclusion\n\nThis project highlights my ability to handle complex SQL queries and provides solutions to real-world business problems in the context of a food delivery service like Zomato. The approach taken here demonstrates a structured problem-solving methodology, data manipulation skills, and the ability to derive actionable insights from data.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n\n![MySQL](https://img.shields.io/badge/SQL-MySQL-blue)\n![License](https://img.shields.io/badge/license-MIT-green)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellymodikalpesh%2Fsql-project-zomato-data-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellymodikalpesh%2Fsql-project-zomato-data-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellymodikalpesh%2Fsql-project-zomato-data-analysis/lists"}