A Food Delivery System
- Led the creation of a Relational Database Management System (RDBMS) for "Swift Bites", a food delivery platform like DoorDash and UberEats, utilizing SQL and managing key business data.
- Designed an Entity-Relationship (ER) diagram to model data, and normalized the database for optimal structure.
- Wrote SQL queries for database and table creation, implemented Python scripts to generate and insert dummy data.
- Devised SQL queries for business insights and implemented update queries to achieve business goals, with validation checks ensuring goal fulfillment.
-
Phase 1: A report about project definition and what data being captured for business
-
Phase 2: A ER diagram for captured data
-
Phase 3: A Relational Mapping which is derived from ER diagram. Final relations with BCNF normalization applied
-
Phase 4: Create tables SQL query, Drop tables SQL query, Business goals SQL query and Update tables SQL query
Phase 4 directory also contains pre generated business goals outputs for verification purpose only(Directory Output and Updated Output)
-
Python Script: A python script convert csv data into SQL insert query for future real world use
- Check Phase 1, Phase 2 and Phase 3 for documentation (Optional)
- Create a new database ‘Swift bites’ (Choose any name for database )
CREATE DATABASE Swift_Bites;
- Select Created database ‘Swift_Bites’
USE Swift_Bites;
-
Create tables running using DB_create_tables.sql (Phase 4 Directory)
-
Insert data all tables using DB_insert_data.sql (Phase 4 Directory)
-
Check business goals using DB_business_goals_queries.sql (Phase 4 Directory)
It will show 20 results for predefined business goals
-
Update data in tables using DB_update.sql (Phase 4 Directory)
-
Perform step 6 again to check output of some results will be changed due to data modification
-
Drop all tables using DB_drop_tables.sql (Phase 4 Directory)(optional)
- Project can be modified to use for real world data
- Check all documentation to see what type of data required for this project
- Insert data into all corresponding csv files (Python Script Directory)
- Open SQL Script.ipynb from Python Script directory
- Run each block of this jupyter notebook to convert each csv data into SQL insert query
- Perform create database, create tables and insert query(generated from script), and finally run business goals query.sql to get analysis for real world data
- RestaurantData: Contains key details about each restaurant on the platform, including its unique ID, name, location (apartment, street, city, state, and ZIP code), contact details (phone number and email), and operating hours.
- RestaurantFacility: Stores information about different facilities offered by each restaurant, linked to the RestaurantData table through the restaurant_id foreign key.
- ItemData: Details all items available on the platform, including item ID, restaurant ID (indicating the restaurant that offers the item), item name, type of cuisine, price, calorie content, item type, and preparation time.
- CustomerData: Maintains data for each customer, such as the customer ID, name, email, contact number, address, ZIP code, date of birth, and date when they joined the platform.
- CustomerFavouriteFood: Stores the favorite food choices of customers. The customer_id field acts as a foreign key, linking this table to the CustomerData table.
- EmployeeData: Keeps records of all employees (delivery persons), including their ID, name, address, ZIP code, date of birth, gender, contact number, pay per hour, and total working hours.
- OrdersData: Manages all orders placed on the platform. Each record includes details about the order ID, customer ID, restaurant ID, employee ID, order and delivery times, charges, distances, estimated and actual times of events, payment type, order status, and tip amount.
- OrderHasItems: Connects the orders with their respective items, indicating the quantity of each item in the order.
- ReviewsData: Stores all reviews given by customers, including the review ID, customer ID, employee ID, restaurant ID, and rating (1 to 5). This data can help you understand customer feedback about your service.
Relational Mapping of Database to Understand relations
- Determine top restaurants by order volume for resource allocation and marketing.
- Identify frequently ordered food items for inventory management and promotions.
- Pinpoint busiest areas by order count to optimize delivery personnel allocation.
- Compute average restaurant ratings to measure customer satisfaction and guide improvements.
- Evaluate delivery employees based on ratings, working hours, order count, and average tips for performance reviews.
- Calculate average delivery time per restaurant for process efficiency.
- Identify top customers by order frequency for personalized promotions and rewards.
- Analyze order volume distribution throughout the day for optimal staffing.
- Find peak order hours per zip code for efficient resource management.
- Determine most popular cuisine type each quarter for menu planning and marketing.
- Track new customers each quarter for trend analysis and marketing adaptation.
- Identify preferred cuisine per state for targeted marketing and partnership decisions.
- Measure average monthly orders per restaurant for sales forecasting and resource management.
- Identify potential fraudulent customer behavior for risk mitigation.
- Determine average order processing time per restaurant for service improvement.
- Generate detailed sales reports per restaurant for revenue analysis and menu planning.
- Identify top 10 items in terms of sales for benchmarking and competitive analysis.
- Match number of delivery personnel to order volume in each zip code for efficient service management.
- Find customers' preferred payment method per quarter to improve payment systems and marketing.
- Analyze customer preferences and behaviors to develop a personalized recommendation engine for enhanced engagement.