GithubHelp home page GithubHelp logo

raghad-el-ghobashy / restaurant-data-analysis-mysql Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 14.67 MB

data data-analysis datacleaning dataset food-ordering menu mysql mysql-database orders restaurant restaurant-menu restaurants script sql sqlscript

restaurant-data-analysis-mysql's Introduction

Restaurant Data Analysis using MySQL πŸ½πŸ‘©β€πŸ³

Overview

This project is a comprehensive analysis of restaurant data using MySQL. It involves transforming a provided dataset into a relational database and executing various SQL queries to extract meaningful insights. The tasks cover a wide range of SQL functionalities, including basic SELECT queries, filtering, sorting, aggregate functions, joins, subqueries, date and time functions, data modification, window functions, common table expressions (CTE), and advanced joins.

Restaurant Data AnalysisπŸ΄πŸ½πŸ‘©β€πŸ³

Restaurant Analysis

Completed Tasks πŸ‘©β€πŸ’»

Below are the tasks completed in this project:

  1. Convert Dataset to SQL Database:

    • Defined and populated tables for menu_details and order_details using the provided dataset.
  2. Basic SELECT Queries:

    • Retrieved all columns from the menu_items table.
    • Displayed the first 5 rows from the order_details table.
  3. Filtering and Sorting:

    • Selected the item_name and price columns for items in the 'Main Course' category, sorted the result by price in descending order.
  4. Aggregate Functions:

    • Calculated the average price of menu items.
    • Found the total number of orders placed.
  5. Joins:

    • Retrieved item_name, order_date, and order_time for all items in the order_details table, including their respective menu item details.
  6. Subqueries:

    • Listed the menu items (item_name) with a price greater than the average price of all menu items.
  7. Date and Time Functions:

    • Extracted the month from the order_date and counted the number of orders placed in each month.
  8. Group By and Having:

    • Showed the categories with the average price greater than $15, including the count of items in each category.
  9. Conditional Statements:

    • Displayed item_name and price, indicating if the item is priced above $20 with a new column named 'Expensive'.
  10. Data Modification - Update:

    • Updated the price of the menu item with item_id = 101 to $25.
  11. Data Modification - Insert:

    • Inserted a new record into the menu_items table for a dessert item.
  12. Data Modification - Delete:

    • Deleted all records from the order_details table where the order_id is less than 100.
  13. Window Functions - Rank:

    • Ranked menu items based on their prices, displaying the item_name and its rank.
  14. Window Functions - Lag and Lead:

    • Displayed the item_name and the price difference from the previous and next menu item.
  15. Common Table Expressions (CTE):

    • Created a CTE that lists menu items with prices above $15, used the CTE to retrieve the count of such items.
  16. Advanced Joins:

    • Retrieved the order_id, item_name, and price for all orders with their respective menu item details, including rows even if there is no matching menu item.

Assessment Video Script πŸ’ΎπŸ’»

SQL Script

restaurant-data-analysis-mysql's People

Contributors

raghad-el-ghobashy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.