cholu6768 / Dannys-Diner-

SQL Case Study Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

View My Profile

Case Study # 1 - Danny's Diner

This case study can be found in the Serious SQL course or on 8weeksqlchallenge.com. Both resources were created by Danny Ma.

forthebadge

logo danny diner

Table of contents

🍣 About

Danny seriously loves Japanese food so in the beginning of 2021, he decides to embark upon a risky venture and opens up a cute little restaurant that sells his 3 favourite foods: sushi, curry and ramen.

Danny’s Diner is in need of your assistance to help the restaurant stay afloat - the restaurant has captured some very basic data from their few months of operation but have no idea how to use their data to help them run the business.

πŸ“ Problem Statement

Danny wants to use the data to answer a few simple questions about his customers, especially about their visiting patterns, how much money they’ve spent and also which menu items are their favourite. Having this deeper connection with his customers will help him deliver a better and more personalised experience for his loyal customers.

He plans on using these insights to help him decide whether he should expand the existing customer loyalty program - additionally he needs help to generate some basic datasets so his team can easily inspect the data without needing to use SQL.

πŸ“‹ Case Study Questions

These are the questions that were provided:

  1. What is the total amount each customer spent at the restaurant?
  2. How many days has each customer visited the restaurant?
  3. What was the first item from the menu purchased by each customer?
  4. What is the most purchased item on the menu and how many times was it purchased by all customers?
  5. Which item was the most popular for each customer?
  6. Which item was purchased first by the customer after they became a member?
  7. Which item was purchased just before the customer became a member?
  8. What is the total items and amount spent for each member before they became a member?
  9. If each $1 spent equates to 10 points and sushi has a 2x points multiplier - how many points would each customer have?
  10. In the first week after a customer joins the program (including their join date) they earn 2x points on all items, not just sushi - how many points do customer A and B have at the end of January?

πŸ”Ž Data Exploration

Danny provided a sample of his overall customer data due to privacy issues. He also provided an entity-relationship diagram (ERD).

erd danny diner

The 3 tables from the ERD were explored in the link below.

data exploration

βš™οΈ Problem Approach

This section showed the possible output for every question so that there was a better focus before fully solving the questions.

problem approach

🧱 Join Implementation

In this section the approach on doing the joins is shown and also how the base tables were generated.

table joins

πŸ”§ Problem Solving

In this final section all the questions including the bonus ones were solved.

table joins

About

SQL Case Study Project

License:MIT License