top of page

End-to-End SQL Analytics for Customer Behavior & Operations | PostgreSQL

Writer: Bhatt Bhoomi
Bhatt Bhoomi
Mar 17
4 min read

Danny’s Dinner | Dataset

Danny’s Dinner is a restaurant dataset focused on customer orders, menu items, and membership data. In this project, I analyzed how much each customer spent, how often they visited, which items they ordered first, and which menu items were the most popular.

I also worked on customer membership behavior. I explored which items customers bought before becoming members, which items they bought first after joining, and how their purchase patterns changed with membership. On top of that, I calculated loyalty points using business rules such as sushi having double points and customers receiving extra points during their first week of membership.

This project helped me practice joins, aggregations, conditional logic, and window functions in a way that felt very close to real business reporting.


Pizza Runner | Dataset

Pizza Runner was one of the most interesting projects because it involved both data cleaning and analysis. The dataset had customer orders, runner deliveries, pizza recipes, toppings, extras, and exclusions. Before doing any analysis, I had to clean messy values like 'null', blank strings, and text values such as km and mins inside numeric fields.

After cleaning the data, I analyzed order volumes, customer ordering patterns, successful deliveries, runner performance, and pizza customizations. I also looked at delivery times, average speed, preparation time, and the relationship between order size and delivery performance.

One part I really enjoyed was normalizing pizza ingredients. I created separate structures for recipes, extras, and exclusions so I could analyze which ingredients were most commonly added or removed. I also created a ratings table to extend the dataset and connect customer feedback with operational performance.

This project showed how SQL can be used not only for analysis, but also for transforming raw and messy data into something reliable and useful.


Foodie-Fi | Dataset

Foodie-Fi is a subscription-based dataset where I analyzed how customers move through different plans over time. The main focus of this project was on churn, upgrades, downgrades, and customer transitions after a free trial.

I calculated how many customers joined the platform, how many churned, and how many churned right after the trial period. I also tracked what plans customers moved to after their initial trial and looked at the percentage breakdown of plans at the end of the year.

Another key part of this project was measuring how long it took customers to upgrade to an annual plan. I grouped those upgrade times into 30-day buckets to make the results more meaningful from a business point of view.

This project was a good example of using SQL to understand customer lifecycle and subscription behavior.


Data Bank | Dataset

Data Bank is based on a financial services scenario with customer nodes, regions, and transaction history. In this project, I explored both customer allocation patterns and transaction behavior.

I started by analyzing the number of unique nodes, how nodes were distributed by region, and how many customers were assigned to each region. Then I looked at customer reallocation, including the average number of days customers stayed on a node and the median, 80th percentile, and 95th percentile of reallocation days across regions.

On the transaction side, I calculated counts and total amounts for each transaction type, average deposit behavior, and monthly activity patterns. This helped me understand how SQL can be used to answer operational and financial questions together in one project.

I liked this project because it introduced more analytical functions like percentiles and made me think more carefully about customer movement over time.


Data Mart | Dataset

Data Mart was more focused on data cleaning, preparation, and reporting. The raw dataset contained weekly sales data, and my first task was to build a cleaned version of the table before starting the analysis.

I converted the week date into a proper date format and created new columns such as week number, month number, and calendar year. I also extracted useful business categories like age band and demographic from coded segment values. Then I generated an average transaction column based on sales and transaction counts.

Once the data was cleaned, I analyzed missing week numbers, yearly transaction totals, monthly sales by region, platform-based transaction counts, and the percentage of sales coming from Retail versus Shopify. I also explored which demographic and age band groups contributed the most to retail sales.

This project was a strong example of how raw transactional data can be cleaned and enriched before it becomes useful for reporting or dashboards.


These projects helped me practice SQL in a more practical way. Instead of only writing standalone queries, I worked with business questions, messy data, customer behavior, and reporting logic.

Across all of them, I used:

  • joins to combine related tables

  • CTEs to break complex logic into smaller steps

  • window functions for ranking and sequence-based analysis

  • aggregations for reporting and summary metrics

  • case statements for business rules and categorization

  • date functions for time-based analysis

  • string functions and normalization for cleaning messy data

More importantly, these projects helped me think like an analyst. I had to understand the business question first, then decide how to structure the SQL solution clearly and correctly.


Final thoughts

For me, these projects are not just SQL exercises. They are portfolio pieces that show how I approach real data problems from cleaning and transformation to analysis and insight generation.

As I continue building my portfolio, I want my projects to show both technical skill and clear thinking. SQL is not only about writing queries. It is about asking the right questions, organizing logic properly, and turning raw data into useful answers. Github : End-to-End SQL Analytics for Customer Behavior & Operations

 
 
 

Recent Posts

See All
Retail [Chips] Strategy & Analytics

From Raw Data to a Real Client Recommendation - Here's Everything I Did If you've been looking for a virtual internship that actually teaches you how analysts work in the real world - not just theory

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • GitHub
  • Linkedin
bottom of page