Without SQL, a Data Specialist is imperfect!

Without SQL, a Data Specialist is imperfect!

SQL- the backbone of Data analysis

Getting started with SQL- the backbone of Data Analysis🗺️

About my previous blog🧵

Well in my previous blog, I briefed you about the open-source: Kaggle, where you can master python programming for data analysis & Machine Learning. Now in this blog, I'll talk about Why SQL is necessary for data analysis?

Discussion of SQL with the help of a case study

Let's begin with the very basic question- What is SQL?

Introduction to SQL💎

SQL stands for Structured Query Language- in short it lets you access and manipulate databases. While many modern industries have geared their product management with NoSQL, SQL remains the ideal choice for many CRM, business intelligence tools, and in-office operations. To learn more about SQL programming, click Roadmap to SQL.

Well, I'm not going to give you a tutorial on SQL, basically, I'll talk about a case study of how a new company figures out its customer preferences with SQL, which will help him deliver a better and more personalized experience for loyal customers.

Why I chose to talk about the case study?

Doing case studies in any domain like web dev, data science, or DevOps, will give you clear insights into the basic to the advanced concepts used in your case study. With one of my case studies, I will explain how helpful SQL can be for a new & small company.

Note: This blog is for beginners who have just landed on the data analysis, for better understanding I have taken the case study of a small company.

Let's begin solving the case study with SQL📚

Getting started with my favorite case study- Danny's Dinner. Danny, the owner of the small company, wants to use the data about his customers, especially about their visiting patterns, how much money they’ve spent, and also which menu items are their favorite, by analyzing the data will help him to deliver a better and more personalized experience for his loyal customers.

🔖 Case study questions which will help to grow & provide better experience for his customers

  • What is the total amount each customer spent at the restaurant?
  • How many days has each customer visited the restaurant?
  • What was the first item from the menu purchased by each customer?
  • What is the most purchased item on the menu and how many times was it purchased by all customers?
  • Which item was the most popular for each customer?
  • Which item was purchased first by the customer after they became a member?
  • Which item was purchased just before the customer became a member?
  • What are the total items and amount spent for each member before they became a member?
  • If each $1 spent equates to 10 points and sushi has a 2x points multiplier - how many points would each customer have?
  • 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 customers A and B have at the end of January?

Here is the answer for the above case study questions.

🔖How I solved this case study?

  • Initially solving this case study, I studied the entire problem statement and then proceeded for solving.
  • The common queries mostly used while solving: SELECT, FROM, JOIN, GROUP BY, ORDER BY, & WHERE (To know more about the SQL queries-click)

  • The common functions used: sum, count, distinct, dense_rank over(partition by....) & also used the loop conditions- if else.

You can check the entire case study along with the code in my GitHub

🔖What I concluded from my case study

  • Found out the relationships & created the databases for the given case study questions.
  • Learned about new queries like dense_rank and many others.

Conclusion💫

In the end, SQL plays a vital role in manipulating and retrieving data in databases & assists in analyzing the datasets of Denny's dinner with different perspectives & outcomes. Thank you for reading!😄